/**Begin D:\PDM_UPGRADE\PDM1\HRPTMC_constraint.sql **/

 EXEC P_ALTERPK 'PK_HRPTMC_ESINDEX', 'T_HRPTMC_ESINDEX', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_HRPTMC_BASEDATAESINDEX') CREATE INDEX IDX_HRPTMC_BASEDATAESINDEX ON T_HRPTMC_ESINDEX ( FBASEDATAESINDEX );


 EXEC P_ALTERPK 'PK_HRPTMC_ESMAPPING', 'T_HRPTMC_ESMAPPING', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_HRPTMC_ESMAPPING_ESINDEX') CREATE INDEX IDX_HRPTMC_ESMAPPING_ESINDEX ON T_HRPTMC_ESMAPPING ( FESINDEXID );


 EXEC P_ALTERPK 'PK_HRPTMC_SHARERECORD', 'T_HRPTMC_SHARERECORD', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_HRPTMC_SHARERECORD') CREATE INDEX IDX_HRPTMC_SHARERECORD ON T_HRPTMC_SHARERECORD ( FREPORTID ,FSHAREUSERID );


 EXEC P_ALTERPK 'PK_HRPTMC_MYSUBSCRIBE', 'T_HRPTMC_MYSUBSCRIBE', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_HRPTMC_MYSUBSCRIBE') CREATE INDEX IDX_HRPTMC_MYSUBSCRIBE ON T_HRPTMC_MYSUBSCRIBE ( FUSER ,FREPORTID );


 EXEC P_ALTERPK 'PK_HRPTMC_RECEIVEUSER', 'T_HRPTMC_RECEIVEUSER', 'FPKID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_RECEIVEUSER') CREATE INDEX IDX_RECEIVEUSER ON T_HRPTMC_RECEIVEUSER ( FID ,FBASEDATAID );


 EXEC P_ALTERPK 'PK_HRPTMC_SHAREFILTERRANGE', 'T_HRPTMC_SHAREFILTERRANGE', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_HRPTMC_SHAREFILTERRANGE') CREATE INDEX IDX_HRPTMC_SHAREFILTERRANGE ON T_HRPTMC_SHAREFILTERRANGE ( FSHARERECORD );


 EXEC P_ALTERPK 'PK_HRPTMC_SUBSCRIBERECORD', 'T_HRPTMC_SUBSCRIBERECORD', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_HRPTMC_SUBSCRIBERECORD') CREATE INDEX IDX_HRPTMC_SUBSCRIBERECORD ON T_HRPTMC_SUBSCRIBERECORD ( FREPORTID ,FUSER );


 EXEC P_ALTERPK 'PK_HRPTMC_MYSUBSCRIBE_L', 'T_HRPTMC_MYSUBSCRIBE_L', 'FPKID', '1';

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



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