/**Begin D:\PDM_UPGRADE\PDM1\HAOS_constraint.sql **/
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_HAOS_PROJTEAMBASE_BO') CREATE INDEX IDX_HAOS_PROJTEAMBASE_BO ON T_HAOS_PROJTEAMBASE ( FBOID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_HAOS_PROJTEAMBASE_PID') CREATE INDEX IDX_HAOS_PROJTEAMBASE_PID ON T_HAOS_PROJTEAMBASE ( FPARENTID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_HAOS_PROJTEAMBASE_BORG') CREATE INDEX IDX_HAOS_PROJTEAMBASE_BORG ON T_HAOS_PROJTEAMBASE ( FBELONGADMINORGID );

 EXEC P_ALTERPK 'PK_HAOS_STAFFACTIVITY', 'T_HAOS_STAFFACTIVITY', 'FID', '1';

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


 EXEC P_ALTERPK 'PK_HAOS_STAFFACTIVITY_L', 'T_HAOS_STAFFACTIVITY_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_HAOS_STAFFACTIVITYTYPE', 'T_HAOS_STAFFACTIVITYTYPE', 'FID', '1';

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


 EXEC P_ALTERPK 'PK_HAOS_STAFFACTIVITYTYPE_L', 'T_HAOS_STAFFACTIVITYTYPE_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_HAOS_STAFFRULECONFIG', 'T_HAOS_STAFFRULECONFIG', 'FID', '1';

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


 EXEC P_ALTERPK 'PK_HAOS_STAFFRULECONFIG_L', 'T_HAOS_STAFFRULECONFIG_L', 'FPKID', '1';

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



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