/**Begin D:\PDM_UPGRADE\PDM1\MSPLAN_constraint.sql **/
 EXEC P_ALTERPK 'PK_T_MSPLAN_CHANGE_RECORD', 'T_MSPLAN_CHANGE_RECORD', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_MSPLAN_CHANGE_CED_P') CREATE INDEX IDX_MSPLAN_CHANGE_CED_P ON T_MSPLAN_CHANGE_RECORD ( FPARENT_ID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_MSPLAN_CHANGE_CED_M') CREATE INDEX IDX_MSPLAN_CHANGE_CED_M ON T_MSPLAN_CHANGE_RECORD ( F_S_MATERIEL );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_MSPLAN_CHANGE_CED_BID') CREATE INDEX IDX_MSPLAN_CHANGE_CED_BID ON T_MSPLAN_CHANGE_RECORD ( F_BILL_ID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_MSPLAN_CHANGE_CED_SID') CREATE INDEX IDX_MSPLAN_CHANGE_CED_SID ON T_MSPLAN_CHANGE_RECORD ( F_BAL_ID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_MSPLAN_CHANGE_CED_WEAK') CREATE INDEX IDX_MSPLAN_CHANGE_CED_WEAK ON T_MSPLAN_CHANGE_RECORD ( FISWEAK );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_MSPLAN_CHANGE_CED_TYPE') CREATE INDEX IDX_MSPLAN_CHANGE_CED_TYPE ON T_MSPLAN_CHANGE_RECORD ( FRESERVESOURCE );


 EXEC P_ALTERPK 'PK_MSPLAN_RESERVECFG', 'T_MSPLAN_RESERVECFG', 'FID', '1';

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

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_MSPLAN_RESERVECFG_B') CREATE INDEX IDX_MSPLAN_RESERVECFG_B ON T_MSPLAN_RESERVECFG ( FBILLOBJECT );


 EXEC P_ALTERPK 'PK_MSPLAN_RESERVECFG_L', 'T_MSPLAN_RESERVECFG_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_T_MSPLAN_RESERVECFGENTRY', 'T_MSPLAN_RESERVECFGENTRY', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_MSPLAN_RSCFGGROUP', 'T_MSPLAN_RSCFGGROUP', 'FID', '1';

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


 EXEC P_ALTERPK 'PK_MSPLAN_RSCFGGROUP_L', 'T_MSPLAN_RSCFGGROUP_L', 'FPKID', '1';

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



/**End D:\PDM_UPGRADE\PDM1\MSPLAN_constraint.sql **/
