/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\SYS_constraint.sql **/
 EXEC P_ALTERPK 'PK_T_SCH_TASK_HISTORY', 'T_SCH_TASK_HISTORY', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_SCH_TASKHISTORY_FJOBID') CREATE INDEX IDX_SCH_TASKHISTORY_FJOBID ON T_SCH_TASK_HISTORY ( FJOBID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_SCH_TASKHISTORY_FSCHID') CREATE INDEX IDX_SCH_TASKHISTORY_FSCHID ON T_SCH_TASK_HISTORY ( FSCHEDULEID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_SCH_TASKHISTORY_ENDTIME') CREATE INDEX IDX_SCH_TASKHISTORY_ENDTIME ON T_SCH_TASK_HISTORY ( FENDTIME );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_SCH_TASKHIS_DISPATCHTIME') CREATE INDEX IDX_SCH_TASKHIS_DISPATCHTIME ON T_SCH_TASK_HISTORY ( FDISPATCHTIME );

/**End E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\SYS_constraint.sql **/
