/**Begin D:\PDM_UPGRADE\PDM1\HRCS_constraint.sql **/
 EXEC P_ALTERPK 'PK_HRCS_ACTSCHEME', 'T_HRCS_ACTSCHEME', 'FID', '1';

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


 EXEC P_ALTERPK 'PK_HRCS_ACTSCHEMEENTRY', 'T_HRCS_ACTSCHEMEENTRY', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_HRCS_ACTSCHEMEPARAM', 'T_HRCS_ACTSCHEMEPARAM', 'FDETAILID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_HRCS_ACTSCHEMEPARAM_DID') CREATE INDEX IDX_HRCS_ACTSCHEMEPARAM_DID ON T_HRCS_ACTSCHEMEPARAM ( FENTRYID );


 EXEC P_ALTERPK 'PK_HRCS_ACTSCHEMEREF', 'T_HRCS_ACTSCHEMEREF', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_HRCS_ACTSCHEME_L', 'T_HRCS_ACTSCHEME_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_HRCS_ACTSCHEMEACTINFO', 'T_HRCS_ACTSCHEMEACTINFO', 'FDETAILID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_HRCS_ACTSCHEMEACTINFO_DID') CREATE INDEX IDX_HRCS_ACTSCHEMEACTINFO_DID ON T_HRCS_ACTSCHEMEACTINFO ( FENTRYID );


 EXEC P_ALTERPK 'PK_HRCS_ACTIVITYCLIENT', 'T_HRCS_ACTIVITYCLIENT', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_HRCS_ACTIVITYCLIENT_ID') CREATE INDEX IDX_HRCS_ACTIVITYCLIENT_ID ON T_HRCS_ACTIVITYCLIENT ( FBIZOBJID );


 EXEC P_ALTERPK 'PK_HRCS_ACTIVITY', 'T_HRCS_ACTIVITY', 'FID', '1';

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


 EXEC P_ALTERPK 'PK_HRCS_ACTIVITYTYPE', 'T_HRCS_ACTIVITYTYPE', 'FID', '1';

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


 EXEC P_ALTERPK 'PK_HRCS_ACTIVITYINS', 'T_HRCS_ACTIVITYINS', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_HRCS_ACTINS_BINDBIZNUM') CREATE INDEX IDX_HRCS_ACTINS_BINDBIZNUM ON T_HRCS_ACTIVITYINS ( FBINDBIZNUM );


 EXEC P_ALTERPK 'PK_HRCS_ACTIVITYTYPE_L', 'T_HRCS_ACTIVITYTYPE_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_HRCS_ACTIVITY_L', 'T_HRCS_ACTIVITY_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_HRCS_ACTIVITYINS_L', 'T_HRCS_ACTIVITYINS_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_HRCS_ACTINSHANDLER', 'T_HRCS_ACTINSHANDLER', 'FPKID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_HRCS_ACTINSHANDLER') CREATE INDEX IDX_HRCS_ACTINSHANDLER ON T_HRCS_ACTINSHANDLER ( FID ,FBASEDATAID );


 EXEC P_ALTERPK 'PK_HRCS_ACTOPREC', 'T_HRCS_ACTOPREC', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_HRCS_ACTINSOPREC') CREATE INDEX IDX_HRCS_ACTINSOPREC ON T_HRCS_ACTOPREC ( FACTIVITYINSID ,FCREATORID );


 EXEC P_ALTERPK 'PK_HRCS_ACTINSOPORI', 'T_HRCS_ACTINSOPORI', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_HRCS_ACTINSOPNEW', 'T_HRCS_ACTINSOPNEW', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_HRCS_ACTOPREC_L', 'T_HRCS_ACTOPREC_L', 'FPKID', '1';

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



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