/**Begin D:\pdm\PDM_UPGRADE\PDM1\HRPTMC_constraint.sql **/
EXEC p_DropIdx 'IDX_HRPTMC_REPORTCONFIG', 'T_HRPTMC_REPORTCONFIG';
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_HRPTMC_REPORTCONFIG') CREATE INDEX IDX_HRPTMC_REPORTCONFIG ON T_HRPTMC_REPORTCONFIG ( FWORKRPTID );

EXEC p_DropIdx 'IDX_HRPTMC_DIMMAP', 'T_HRPTMC_DIMMAP';
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_HRPTMC_DIMMAP') CREATE INDEX IDX_HRPTMC_DIMMAP ON T_HRPTMC_DIMMAP ( FPREINDEXID );

EXEC p_DropIdx 'IDX_HRPTMC_ROWFIELD', 'T_HRPTMC_ROWFIELD';
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_HRPTMC_ROWFIELD') CREATE INDEX IDX_HRPTMC_ROWFIELD ON T_HRPTMC_ROWFIELD ( FPARENTID );

EXEC p_DropIdx 'IDX_HRPTMC_COLFIELD', 'T_HRPTMC_COLFIELD';
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_HRPTMC_COLFIELD') CREATE INDEX IDX_HRPTMC_COLFIELD ON T_HRPTMC_COLFIELD ( FWORKRPTID );

EXEC p_DropIdx 'IDX_HRPTMC_DISPSCMCHG', 'T_HRPTMC_DISPSCMCHG';
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_HRPTMC_DISPSCMCHG') CREATE INDEX IDX_HRPTMC_DISPSCMCHG ON T_HRPTMC_DISPSCMCHG ( FWORKRPTID );

EXEC p_DropIdx 'IDX_HRPTMC_RPTDISPSCM', 'T_HRPTMC_RPTDISPSCM';
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_HRPTMC_RPTDISPSCM') CREATE INDEX IDX_HRPTMC_RPTDISPSCM ON T_HRPTMC_RPTDISPSCM ( FWORKRPTID );

EXEC p_DropIdx 'IDX_JUMPRPTID', 'T_HRPTMC_RPTJUMP';
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_JUMPRPTID') CREATE INDEX IDX_JUMPRPTID ON T_HRPTMC_RPTJUMP ( FWORKRPTID );

EXEC p_DropIdx 'IDX_HRPTMC_RPTCOMREF', 'T_HRPTMC_RPTCOMREF';
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_HRPTMC_RPTCOMREF') CREATE INDEX IDX_HRPTMC_RPTCOMREF ON T_HRPTMC_RPTCOMREF ( FWORKRPTID );

 EXEC P_ALTERPK 'PK_HRPTMC_WORKREPORT', 'T_HRPTMC_WORKREPORT', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_HRPTMC_WORKREPORT') CREATE INDEX IDX_HRPTMC_WORKREPORT ON T_HRPTMC_WORKREPORT ( FRPTMANAGEID );



/**End D:\pdm\PDM_UPGRADE\PDM1\HRPTMC_constraint.sql **/
