/**Begin D:\pdm\PDM_UPGRADE\PDM1\HRPTMC_constraint.sql **/
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_HRPTC_RPTPERMDATA2') CREATE INDEX IDX_HRPTC_RPTPERMDATA2 ON T_HRPTC_RPTPERMDATA ( FREPORTID ,FQUERYFIELDID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_HRPTC_RPTPERMDATA1') CREATE INDEX IDX_HRPTC_RPTPERMDATA1 ON T_HRPTC_RPTPERMDATA ( FREPORTPERMID );

 EXEC P_ALTERPK 'PK_HRPTC_RPTALOCPERM', 'T_HRPTC_RPTALOCPERM', 'FREPORTPERMID', '1';

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


 EXEC P_ALTERPK 'PK_HRPTC_RPTALOCPERM_L', 'T_HRPTC_RPTALOCPERM_L', 'FPKID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_HRPTC_RPTALOCPERM_L') CREATE INDEX IDX_HRPTC_RPTALOCPERM_L ON T_HRPTC_RPTALOCPERM_L ( FLOCALEID ,FREPORTPERMID );



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