/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\MRP_constraint.sql **/

 EXEC P_ALTERPK 'PK_T_MRP_CACULATELOG', 'T_MRP_CACULATELOG', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_MRP_CACULATELOG_FNUMBER') CREATE INDEX IDX_MRP_CACULATELOG_FNUMBER ON T_MRP_CACULATELOG ( FNUMBER ,FCREATEORGID );


 EXEC P_ALTERPK 'PK_T_MRP_CACULATELOGENTRY', 'T_MRP_CACULATELOGENTRY', 'FENTRYID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_MRP_CACULATELOGENTRY') CREATE INDEX IDX_MRP_CACULATELOGENTRY ON T_MRP_CACULATELOGENTRY ( FID ,FSEQ );

 EXEC P_ALTERPK 'PK_T_MRP_CALPLANCONFIG', 'T_MRP_CALPLANCONFIG', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_MRP_CALPLANCONFIG') CREATE INDEX IDX_MRP_CALPLANCONFIG ON T_MRP_CALPLANCONFIG ( FNUMBER ,FCREATEORGID );


 EXEC P_ALTERPK 'PK_T_MRP_CALPLANCONFIG_L', 'T_MRP_CALPLANCONFIG_L', 'FPKID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_MRP_CALPLANCONFIG_L') CREATE INDEX IDX_MRP_CALPLANCONFIG_L ON T_MRP_CALPLANCONFIG_L ( FID ,FLOCALEID );


 EXEC P_ALTERPK 'PK_T_MRP_CALPLANCONFIGENTRY', 'T_MRP_CALPLANCONFIGENTRY', 'FENTRYID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_MRP_CALPLANCONFIG_E') CREATE INDEX IDX_MRP_CALPLANCONFIG_E ON T_MRP_CALPLANCONFIGENTRY ( FID ,FSEQ );


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