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

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_HOMTASK_FOPERATORID') CREATE INDEX IDX_HOMTASK_FOPERATORID ON T_HOM_SSCTASK_Q ( FOPERATORID );


 EXEC P_ALTERPK 'PK_HOM_SSCTASKHIS_Q', 'T_HOM_SSCTASKHIS_Q', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_HOMTASKHIS_FOPERATORID') CREATE INDEX IDX_HOMTASKHIS_FOPERATORID ON T_HOM_SSCTASKHIS_Q ( FOPERATORID );


 EXEC P_ALTERPK 'PK_HOM_SSCTASK', 'T_HOM_SSCTASK', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_HOMTASK_FSSCID') CREATE INDEX IDX_HOMTASK_FSSCID ON T_HOM_SSCTASK ( FSSCID );

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

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_HOMTASK_FBILLTYPEID') CREATE INDEX IDX_HOMTASK_FBILLTYPEID ON T_HOM_SSCTASK ( FBILLTYPEID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_HOMTASK_FTASKTYPEID') CREATE INDEX IDX_HOMTASK_FTASKTYPEID ON T_HOM_SSCTASK ( FTASKTYPEID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_HOMTASK_FBILLLONGID') CREATE INDEX IDX_HOMTASK_FBILLLONGID ON T_HOM_SSCTASK ( FBILLLONGID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_HOMTASK_FCREATETIME') CREATE INDEX IDX_HOMTASK_FCREATETIME ON T_HOM_SSCTASK ( FCREATETIME );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_HOMTASK_FRECEIVETIME') CREATE INDEX IDX_HOMTASK_FRECEIVETIME ON T_HOM_SSCTASK ( FRECEIVETIME );


 EXEC P_ALTERPK 'PK_HOM_SSCTASKHIS', 'T_HOM_SSCTASKHIS', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_HOMTASKHIS_FSSCID') CREATE INDEX IDX_HOMTASKHIS_FSSCID ON T_HOM_SSCTASKHIS ( FSSCID );

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

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_HOMTASKHIS_FBILLTYPEID') CREATE INDEX IDX_HOMTASKHIS_FBILLTYPEID ON T_HOM_SSCTASKHIS ( FBILLTYPEID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_HOMTASKHIS_FTASKTYPEID') CREATE INDEX IDX_HOMTASKHIS_FTASKTYPEID ON T_HOM_SSCTASKHIS ( FTASKTYPEID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_HOMTASKHIS_FBILLLONGID') CREATE INDEX IDX_HOMTASKHIS_FBILLLONGID ON T_HOM_SSCTASKHIS ( FBILLLONGID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_HOMTASKHIS_FCREATETIME') CREATE INDEX IDX_HOMTASKHIS_FCREATETIME ON T_HOM_SSCTASKHIS ( FCREATETIME );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_HOMTASKHIS_FRECEIVETIME') CREATE INDEX IDX_HOMTASKHIS_FRECEIVETIME ON T_HOM_SSCTASKHIS ( FRECEIVETIME );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_HOMTASKHIS_FSOURCETASKID') CREATE INDEX IDX_HOMTASKHIS_FSOURCETASKID ON T_HOM_SSCTASKHIS ( FSOURCETASKID );



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