/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\BCM_constraint.sql **/
 EXEC P_ALTERPK 'PK_T_BCM_INVRELATIONDEFINE_L', 'T_BCM_INVRELATIONDEFINE_L', 'FPKID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BCM_INVRELADEFINE_L_FID') CREATE INDEX IDX_BCM_INVRELADEFINE_L_FID ON T_BCM_INVRELATIONDEFINE_L ( FID );


 EXEC P_ALTERPK 'PK_T_BCM_INVRELATIONSET', 'T_BCM_INVRELATIONSET', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BCM_INVRELATIONSET_M') CREATE INDEX IDX_BCM_INVRELATIONSET_M ON T_BCM_INVRELATIONSET ( FMODELID );


 EXEC P_ALTERPK 'PK_T_BCM_MERGECONFIG_L', 'T_BCM_MERGECONFIG_L', 'FPKID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_T_BCM_MERGECONFIG_L') CREATE INDEX IDX_T_BCM_MERGECONFIG_L ON T_BCM_MERGECONFIG_L ( FID );


 EXEC P_ALTERPK 'PK_T_BCM_INVRELATIONDEFINE', 'T_BCM_INVRELATIONDEFINE', 'FENTRYID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BCM_INVRELADEFINE_FID') CREATE INDEX IDX_BCM_INVRELADEFINE_FID ON T_BCM_INVRELATIONDEFINE ( FID );


 EXEC P_ALTERPK 'PK_T_BCM_MERGECONFIG', 'T_BCM_MERGECONFIG', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_T_BCM_MERGECONFIG_NM') CREATE INDEX IDX_T_BCM_MERGECONFIG_NM ON T_BCM_MERGECONFIG ( FMODEL ,FNUMBER );


 EXEC P_ALTERPK 'PK_T_BCM_MERGECONFIGENTRY', 'T_BCM_MERGECONFIGENTRY', 'FENTRYID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BCM_MCONFIGENTRY') CREATE INDEX IDX_BCM_MCONFIGENTRY ON T_BCM_MERGECONFIGENTRY ( FID );



/**End E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\BCM_constraint.sql **/
