/**Begin D:\k3Cloud\PDM_UPGRADE\PDM1\MDS_constraint.sql **/
 EXEC P_ALTERPK 'PK_MRP_RES_SCHEME', 'T_MRP_RES_SCHEME', 'FID', '1';

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


 EXEC P_ALTERPK 'PK_MRP_RES_SCHEME_L', 'T_MRP_RES_SCHEME_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_MRP_RES_SCHLIST', 'T_MRP_RES_SCHLIST', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_MRP_RES_SCHORG', 'T_MRP_RES_SCHORG', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_MRP_RES_SCHPLAN', 'T_MRP_RES_SCHPLAN', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_MRP_RES_SCHREQ', 'T_MRP_RES_SCHREQ', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_MRP_RES_SCHSUPPLY', 'T_MRP_RES_SCHSUPPLY', 'FENTRYID', '1';

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



/**End D:\k3Cloud\PDM_UPGRADE\PDM1\MDS_constraint.sql **/
