/**Begin D:\PDM_UPGRADE\PDM1\HRDI_constraint.sql **/
 EXEC P_ALTERPK 'PK_HRDI_FIELDBLACKLIST', 'T_HRDI_FIELDBLACKLIST', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_HRDI_BLACKLIST_ENTITYOBJ') CREATE INDEX IDX_HRDI_BLACKLIST_ENTITYOBJ ON T_HRDI_FIELDBLACKLIST ( FENTITYOBJID );


 EXEC P_ALTERPK 'PK_HRDI_FIELDBLACKLIST_L', 'T_HRDI_FIELDBLACKLIST_L', 'FPKID', '1';

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

EXEC P_ALTERPK 'PK_HRDI_MIDTABLECONFTPL', 'T_HRDI_MIDTABLECONFTPL', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_HRDI_MIDTABLECONFTPL') CREATE INDEX IDX_HRDI_MIDTABLECONFTPL ON T_HRDI_MIDTABLECONFTPL ( FENTITYOBJID );


 EXEC P_ALTERPK 'PK_HRDI_MIDTABLECONFTPL_L', 'T_HRDI_MIDTABLECONFTPL_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_HRDI_MIDTABLETPLENTRY', 'T_HRDI_MIDTABLETPLENTRY', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_HRDI_MIDTABLETPLENTRY_L', 'T_HRDI_MIDTABLETPLENTRY_L', 'FPKID', '1';

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

  EXEC P_ALTERPK 'PK_HRDI_TPLINITENTITYOBJ', 'T_HRDI_TPLINITENTITYOBJ', 'FPKID', '1';

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

 EXEC P_ALTERPK 'PK_HRDI_INTSCENERULE', 'T_HRDI_INTSCENERULE', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_HRDI_INTSCENERULE') CREATE INDEX IDX_HRDI_INTSCENERULE ON T_HRDI_INTSCENERULE ( FENTITYOBJID );


 EXEC P_ALTERPK 'PK_HRDI_INTSCENERULE_L', 'T_HRDI_INTSCENERULE_L', 'FPKID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_HRDI_INTSCENERULE_L') CREATE INDEX IDX_HRDI_INTSCENERULE_L ON T_HRDI_INTSCENERULE_L ( FID ,FLOCALEID );
 
 EXEC P_ALTERPK 'PK_HRDI_INTRULEENTRY', 'T_HRDI_INTRULEENTRY', 'FENTRYID', '1';

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


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