/**Begin D:\PDM_UPGRADE\PDM1\HOM_constraint.sql **/
EXEC p_DropIdx 'IDX_HOM_ONBRDBILL_FCANDIDATEID', 'T_HOM_ONBRDBILL';
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_HOM_ONBRDBILL_FCANDIDATEID') CREATE INDEX IDX_HOM_ONBRDBILL_FCANDIDATEID ON T_HOM_ONBRDBILL ( FCANDIDATEID );

EXEC p_DropIdx 'IDX_HOM_ONBRDBILL_FPRBILLID', 'T_HOM_ONBRDBILL_B';
EXEC p_DropIdx 'IDX_HOM_ONBRDBILL_FPRBATCHBILL', 'T_HOM_ONBRDBILL_B';
 EXEC P_ALTERPK 'PK_HOM_ONBRD_BCHG_P', 'T_HOM_ONBRD_BCHG_P', 'FENTRYID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_HOM_BEFORE_PERSONID') CREATE INDEX IDX_HOM_BEFORE_PERSONID ON T_HOM_ONBRD_BCHG_P ( FPERSONID );


 EXEC P_ALTERPK 'PK_HOM_ONBRD_BCHG_E', 'T_HOM_ONBRD_BCHG_E', 'FENTRYID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_HOM_BEFORE_EMPLOYEEID') CREATE INDEX IDX_HOM_BEFORE_EMPLOYEEID ON T_HOM_ONBRD_BCHG_E ( FEMPLOYEEID );


 EXEC P_ALTERPK 'PK_HOM_ONBRD_BCHG_D', 'T_HOM_ONBRD_BCHG_D', 'FENTRYID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_HOM_BEFORE_DEPEMPID') CREATE INDEX IDX_HOM_BEFORE_DEPEMPID ON T_HOM_ONBRD_BCHG_D ( FDEPEMPID );


 EXEC P_ALTERPK 'PK_HOM_ONBRD_ACHG_P', 'T_HOM_ONBRD_ACHG_P', 'FENTRYID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_HOM_AFTER_PERSONID') CREATE INDEX IDX_HOM_AFTER_PERSONID ON T_HOM_ONBRD_ACHG_P ( FPERSONID );


 EXEC P_ALTERPK 'PK_HOM_ONBRD_ACHG_E', 'T_HOM_ONBRD_ACHG_E', 'FENTRYID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_HOM_ONBRD_ACHG_E') CREATE INDEX IDX_HOM_ONBRD_ACHG_E ON T_HOM_ONBRD_ACHG_E ( FEMPLOYEEID );


 EXEC P_ALTERPK 'PK_HOM_ONBRD_ACHG_D', 'T_HOM_ONBRD_ACHG_D', 'FENTRYID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_HOM_AFTER_DEPEMPID') CREATE INDEX IDX_HOM_AFTER_DEPEMPID ON T_HOM_ONBRD_ACHG_D ( FDEPEMPID );



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