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

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


 EXEC P_ALTERPK 'PK_HRCS_PROMPT_L', 'T_HRCS_PROMPT_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_HRCS_PROMPTCONTENT', 'T_HRCS_PROMPTCONTENT', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_HRCS_PROMPTCONTENT') CREATE INDEX IDX_HRCS_PROMPTCONTENT ON T_HRCS_PROMPTCONTENT ( FPROMPTID ,FLOCALEID );


 EXEC P_ALTERPK 'PK_HRCS_PROMPTIMPORT', 'T_HRCS_PROMPTIMPORT', 'FID', '1';

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


 EXEC P_ALTERPK 'PK_HRCS_PROMPTIMPORT_L', 'T_HRCS_PROMPTIMPORT_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_HRCS_PROMPTRULE', 'T_HRCS_PROMPTRULE', 'FID', '1';

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


 EXEC P_ALTERPK 'PK_HRCS_PROMPTRULE_L', 'T_HRCS_PROMPTRULE_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_HRCS_ASSOCENTITYTMPL', 'T_HRCS_ASSOCENTITYTMPL', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_HRCS_MULTIENTITYIMPTMPL', 'T_HRCS_MULTIENTITYIMPTMPL', 'FID', '1';

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


 EXEC P_ALTERPK 'PK_HRCS_MULTIENTITYIMPTMPL_L', 'T_HRCS_MULTIENTITYIMPTMPL_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_HRCS_HRCLOUD', 'T_HRCS_HRCLOUD', 'FID', '1';

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


 EXEC P_ALTERPK 'PK_HRCS_ROLEFIELD', 'T_HRCS_ROLEFIELD', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_HRCS_ROLEFIELD') CREATE INDEX IDX_HRCS_ROLEFIELD ON T_HRCS_ROLEFIELD ( FROLEID ,FENTITYTYPEID );


 EXEC P_ALTERPK 'PK_HRCS_ROLEFIELDENTRY', 'T_HRCS_ROLEFIELDENTRY', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_HRCS_USERFIELD', 'T_HRCS_USERFIELD', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_HRCS_USERFIELD') CREATE INDEX IDX_HRCS_USERFIELD ON T_HRCS_USERFIELD ( FUSERROLEREALTID );


 EXEC P_ALTERPK 'PK_HRCS_USERFIELDENTRY', 'T_HRCS_USERFIELDENTRY', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_HRCS_ROLEBDRULEENTRY', 'T_HRCS_ROLEBDRULEENTRY', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_HRCS_ROLEDATARULE', 'T_HRCS_ROLEDATARULE', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_HRCS_ROLEDATARULE') CREATE INDEX IDX_HRCS_ROLEDATARULE ON T_HRCS_ROLEDATARULE ( FROLEID ,FENTITYTYPEID );


 EXEC P_ALTERPK 'PK_HRCS_ROLEDATARULEENTRY', 'T_HRCS_ROLEDATARULEENTRY', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_HRCS_DATARULE_L', 'T_HRCS_DATARULE_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_HRCS_USERBDRULEENTRY', 'T_HRCS_USERBDRULEENTRY', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_HRCS_USERDATARULE', 'T_HRCS_USERDATARULE', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_HRCS_USERDATARULE') CREATE INDEX IDX_HRCS_USERDATARULE ON T_HRCS_USERDATARULE ( FUSERROLEREALTID );


 EXEC P_ALTERPK 'PK_HRCS_PERMTEMP', 'T_HRCS_PERMTEMP', 'FID', '1';

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


 EXEC P_ALTERPK 'PK_HRCS_USERROLERELAT', 'T_HRCS_USERROLERELAT', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_HRCS_USERROLERELAT') CREATE INDEX IDX_HRCS_USERROLERELAT ON T_HRCS_USERROLERELAT ( FPERMFILEID ,FROLEID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_HRCS_USERROLERELAT_USERID') CREATE INDEX IDX_HRCS_USERROLERELAT_USERID ON T_HRCS_USERROLERELAT ( FUSERID );


 EXEC P_ALTERPK 'PK_HRCS_DATARULE', 'T_HRCS_DATARULE', 'FID', '1';

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


 EXEC P_ALTERPK 'PK_HRCS_USERDATARULEENTRY', 'T_HRCS_USERDATARULEENTRY', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_HRCS_IGNOREPERMENTITY', 'T_HRCS_IGNOREPERMENTITY', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_HRCS_IGNOREPERMENTITY') CREATE INDEX IDX_HRCS_IGNOREPERMENTITY ON T_HRCS_IGNOREPERMENTITY ( FAPPID ,FENTITYTYPEID );


 EXEC P_ALTERPK 'PK_HRCS_ROLEDIMENSION', 'T_HRCS_ROLEDIMENSION', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_HRCS_ROLEDIMENSION') CREATE INDEX IDX_HRCS_ROLEDIMENSION ON T_HRCS_ROLEDIMENSION ( FROLEID ,FDIMENSIONID );


 EXEC P_ALTERPK 'PK_HRCS_DIMENSIONPROP', 'T_HRCS_DIMENSIONPROP', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_HRCS_DIMENSION', 'T_HRCS_DIMENSION', 'FID', '1';

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


 EXEC P_ALTERPK 'PK_HRCS_DIMENSIONENUM', 'T_HRCS_DIMENSIONENUM', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_HRCS_DIMENSIONENUM_L', 'T_HRCS_DIMENSIONENUM_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_HRCS_DIMENSION_L', 'T_HRCS_DIMENSION_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_HRCS_USERADMINORG', 'T_HRCS_USERADMINORG', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_HRCS_USERADMINORG') CREATE INDEX IDX_HRCS_USERADMINORG ON T_HRCS_USERADMINORG ( FUSERROLERELATID );


 EXEC P_ALTERPK 'PK_HRCS_ROLEDIMENSION_L', 'T_HRCS_ROLEDIMENSION_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_HRCS_ORGPERMCONFIG', 'T_HRCS_ORGPERMCONFIG', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_HRCS_ORGPERMCONFIG') CREATE INDEX IDX_HRCS_ORGPERMCONFIG ON T_HRCS_ORGPERMCONFIG ( FENTITYTYPEID ,FPROPKEY );



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