/**Begin C:\Users\rd_jin_gu\Documents\work\PDM_UPGRADE\PDM1\HRCS_constraint.sql **/
 EXEC P_ALTERPK 'PK_HRCS_DATAROLECONFIG', 'T_HRCS_DATAROLECONFIG', 'FID', '1';

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


 EXEC P_ALTERPK 'PK_HRCS_DATASORTENTRY', 'T_HRCS_DATASORTENTRY', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_HRCS_RETENTIONCONFIG', 'T_HRCS_RETENTIONCONFIG', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_HRCS_RETENTIONCONFIG') CREATE INDEX IDX_HRCS_RETENTIONCONFIG ON T_HRCS_RETENTIONCONFIG ( FROLEID );


 EXEC P_ALTERPK 'PK_HRCS_RETENTIONPERSON', 'T_HRCS_RETENTIONPERSON', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_HRCS_ROLEIDANDTYPE') CREATE INDEX IDX_HRCS_ROLEIDANDTYPE ON T_HRCS_RETENTIONPERSON ( FDATASUBJECTID ,FDATASUBJECTTYPE );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_HRCS_PEDANDAPPANDSTATUS') CREATE INDEX IDX_HRCS_PEDANDAPPANDSTATUS ON T_HRCS_RETENTIONPERSON ( FPLANEXECDATE ,FBIZAPPID ,FEXECSTATUS );


 EXEC P_ALTERPK 'PK_HRCS_DATAROLECONFIG_L', 'T_HRCS_DATAROLECONFIG_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_HRCS_DATASORTENTRY_L', 'T_HRCS_DATASORTENTRY_L', 'FPKID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_HRCS_DATASORTENTRY_L') CREATE INDEX IDX_HRCS_DATASORTENTRY_L ON T_HRCS_DATASORTENTRY_L ( FENTRYID ,FLOCALEID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_HRCS_ROLESORT') CREATE INDEX IDX_HRCS_ROLESORT ON T_HRCS_RETCONFIGENTRY ( FROLESORTID );


 EXEC P_ALTERPK 'PK_HRCS_RETENTIONCONFIGAPP', 'T_HRCS_RETENTIONCONFIGAPP', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_HRCS_PRIVACYSIGNING', 'T_HRCS_PRIVACYSIGNING', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_HRCS_PRIVACYSIGNING') CREATE INDEX IDX_HRCS_PRIVACYSIGNING ON T_HRCS_PRIVACYSIGNING ( FFORMID ,FLOCALEID );


 EXEC P_ALTERPK 'PK_HRCS_PRIVACYUSERTYPE', 'T_HRCS_PRIVACYUSERTYPE', 'FID', '1';

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



/**End C:\Users\rd_jin_gu\Documents\work\PDM_UPGRADE\PDM1\HRCS_constraint.sql **/
