/**Begin D:\PDM_UPGRADE\PDM1\HOM_constraint.sql **/
 EXEC P_ALTERPK 'PK_HOM_COLLECTLOG', 'T_HOM_COLLECTLOG', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_HOM_COLLECTLOG') CREATE INDEX IDX_HOM_COLLECTLOG ON T_HOM_COLLECTLOG ( FCOLLECTACTIVITYID );


 EXEC P_ALTERPK 'PK_HOM_COLLECTLOG_L', 'T_HOM_COLLECTLOG_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_HOM_COLLECTLOGENTITY', 'T_HOM_COLLECTLOGENTITY', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_HOM_COLLECTLOGENTITY_L', 'T_HOM_COLLECTLOGENTITY_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_HOM_COLLECTLOGSUB', 'T_HOM_COLLECTLOGSUB', 'FDETAILID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_HOM_COLLECTLOGENTITYSUB') CREATE INDEX IDX_HOM_COLLECTLOGENTITYSUB ON T_HOM_COLLECTLOGSUB ( FENTRYID ,FSEQ );


 EXEC P_ALTERPK 'PK_HOM_COLLECTLOGSUB_L', 'T_HOM_COLLECTLOGSUB_L', 'FPKID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_HOM_COLLECTLOGSUB_L') CREATE INDEX IDX_HOM_COLLECTLOGSUB_L ON T_HOM_COLLECTLOGSUB_L ( FDETAILID ,FLOCALEID );



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