/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\MRP_constraint.sql **/
 EXEC P_ALTERPK 'PK_T_MRP_PLANDISPATCH_L', 'T_MRP_PLANDISPATCH_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_T_MRP_COOP_PARAM', 'T_MRP_COOP_PARAM', 'FID', '1';

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


 EXEC P_ALTERPK 'PK_T_MRP_COOP_PARAM_L', 'T_MRP_COOP_PARAM_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_T_MRP_COOP_PARAMENTRY', 'T_MRP_COOP_PARAMENTRY', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_T_MRP_PLANDISPATCH', 'T_MRP_PLANDISPATCH', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_MRP_PLANDISPATCH') CREATE INDEX IDX_MRP_PLANDISPATCH ON T_MRP_PLANDISPATCH ( FNUMBER );



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