/**Begin D:\PDM_UPGRADE\PDM1\HAOS_constraint.sql **/
 EXEC P_ALTERPK 'PK_HAOS_PROJCHANGETYPE', 'T_HAOS_PROJCHANGETYPE', 'FID', '1';

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


 EXEC P_ALTERPK 'PK_HAOS_PROJCHANGETYPE_L', 'T_HAOS_PROJCHANGETYPE_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_HAOS_PROJCHANGEREASON', 'T_HAOS_PROJCHANGEREASON', 'FID', '1';

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


 EXEC P_ALTERPK 'PK_HAOS_PROJCHANGEREASON_L', 'T_HAOS_PROJCHANGEREASON_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_HAOS_PROJCHANGESCENE', 'T_HAOS_PROJCHANGESCENE', 'FID', '1';

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


 EXEC P_ALTERPK 'PK_HAOS_PROJCHANGESCENE_L', 'T_HAOS_PROJCHANGESCENE_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_HAOS_PROJCHANGEOPERATE', 'T_HAOS_PROJCHANGEOPERATE', 'FID', '1';

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


 EXEC P_ALTERPK 'PK_HAOS_PROJCHANGEOPERATE_L', 'T_HAOS_PROJCHANGEOPERATE_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_HAOS_PROJXCHANGEREASON', 'T_HAOS_PROJXCHANGEREASON', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_HAOS_PROJCHEVENTSUM', 'T_HAOS_PROJCHEVENTSUM', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_HAOS_PROJCHEVENTSUM') CREATE INDEX IDX_HAOS_PROJCHEVENTSUM ON T_HAOS_PROJCHEVENTSUM ( FPROJTEAMID );


 EXEC P_ALTERPK 'PK_HAOS_PROJCHOPDETAIL', 'T_HAOS_PROJCHOPDETAIL', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_HAOS_PROJCHOPDETAIL') CREATE INDEX IDX_HAOS_PROJCHOPDETAIL ON T_HAOS_PROJCHOPDETAIL ( FPROJTEAMID );


 EXEC P_ALTERPK 'PK_HAOS_PROJCHEVENTDETAIL', 'T_HAOS_PROJCHEVENTDETAIL', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_HAOS_PROJCHEVENTDETAIL') CREATE INDEX IDX_HAOS_PROJCHEVENTDETAIL ON T_HAOS_PROJCHEVENTDETAIL ( FPROJTEAMID );



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