/**Begin D:\PDM_UPGRADE\PDM1\HRCS_constraint.sql **/
 EXEC P_ALTERPK 'PK_HRCS_ENTITYDIMENTRY_L', 'T_HRCS_ENTITYDIMENTRY_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_HRCS_ENTITYCTRL', 'T_HRCS_ENTITYCTRL', 'FID', '1';

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


 EXEC P_ALTERPK 'PK_HRCS_ENTITYDIMENTRY', 'T_HRCS_ENTITYDIMENTRY', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_HRCS_ENTITYTREECFG', 'T_HRCS_ENTITYTREECFG', 'FID', '1';

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


 EXEC P_ALTERPK 'PK_HRCS_PERMRELAT', 'T_HRCS_PERMRELAT', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_HRCS_PERMRELAT') CREATE INDEX IDX_HRCS_PERMRELAT ON T_HRCS_PERMRELAT ( FENTITYTYPEID );


 EXEC P_ALTERPK 'PK_HRCS_PERMRELATENTRY', 'T_HRCS_PERMRELATENTRY', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_HRCS_ENTITYFORBID', 'T_HRCS_ENTITYFORBID', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_HRCS_ENTITYFORBID') CREATE INDEX IDX_HRCS_ENTITYFORBID ON T_HRCS_ENTITYFORBID ( FENTITYTYPEID );


 EXEC P_ALTERPK 'PK_HRCS_ROLEDIMGRP', 'T_HRCS_ROLEDIMGRP', 'FID', '1';

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


 EXEC P_ALTERPK 'PK_HRCS_ROLEDIMVAL', 'T_HRCS_ROLEDIMVAL', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_HRCS_USERROLEDIMGRP', 'T_HRCS_USERROLEDIMGRP', 'FID', '1';

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


 EXEC P_ALTERPK 'PK_HRCS_USERROLEDIMVAL', 'T_HRCS_USERROLEDIMVAL', 'FENTRYID', '1';

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



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