/**Begin D:\PDM_UPGRADE\PDM1\HRPTMC_constraint.sql **/
 EXEC P_ALTERPK 'PK_HRPTMC_CALREFFIELD', 'T_HRPTMC_CALREFFIELD', 'FENTRYID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_HRPTMC_CALREFFIELD') CREATE INDEX IDX_HRPTMC_CALREFFIELD ON T_HRPTMC_CALREFFIELD ( FID );


 EXEC P_ALTERPK 'PK_HRPTMC_CALCULATEFIELD_L', 'T_HRPTMC_CALCULATEFIELD_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_HRPTMC_CALCULATEFIELD', 'T_HRPTMC_CALCULATEFIELD', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_HRPTMC_CALANOBJ') CREATE INDEX IDX_HRPTMC_CALANOBJ ON T_HRPTMC_CALCULATEFIELD ( FANOBJID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_HRPTMC_CALREPORT') CREATE INDEX IDX_HRPTMC_CALREPORT ON T_HRPTMC_CALCULATEFIELD ( FREPORTID );


 EXEC P_ALTERPK 'PK_HRPTMC_ANOBJQUERYFIELD_L', 'T_HRPTMC_ANOBJQUERYFIELD_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_HRPTMC_ANALYSISOBJECT_L', 'T_HRPTMC_ANALYSISOBJECT_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_HRPTMC_ANOBJJOINCOND', 'T_HRPTMC_ANOBJJOINCOND', 'FENTRYID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_HRPTMC_ANOBJJOINCOND') CREATE INDEX IDX_HRPTMC_ANOBJJOINCOND ON T_HRPTMC_ANOBJJOINCOND ( FID );


 EXEC P_ALTERPK 'PK_HRPTMC_ANOBJENTJOINREL', 'T_HRPTMC_ANOBJENTJOINREL', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_HRPTMC_ANOBJENTJOINREL') CREATE INDEX IDX_HRPTMC_ANOBJENTJOINREL ON T_HRPTMC_ANOBJENTJOINREL ( FANOBJID );


 EXEC P_ALTERPK 'PK_HRPTMC_ANOBJJOINENTITY', 'T_HRPTMC_ANOBJJOINENTITY', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_HRPTMC_ANOBJJOINENTITY') CREATE INDEX IDX_HRPTMC_ANOBJJOINENTITY ON T_HRPTMC_ANOBJJOINENTITY ( FANOBJID );


 EXEC P_ALTERPK 'PK_HRPTMC_ANOBJQUERYFIELD', 'T_HRPTMC_ANOBJQUERYFIELD', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_HRPTMC_ANOBJQUERYFIELD') CREATE INDEX IDX_HRPTMC_ANOBJQUERYFIELD ON T_HRPTMC_ANOBJQUERYFIELD ( FANOBJID );


 EXEC P_ALTERPK 'PK_HRPTMC_COLFIELD', 'T_HRPTMC_COLFIELD', 'FID', '1';

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


 EXEC P_ALTERPK 'PK_HRPTMC_COLFIELD_L', 'T_HRPTMC_COLFIELD_L', 'FPKID', '1';

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

 EXEC P_ALTERPK 'PK_HRPTMC_REPORTCONFIG', 'T_HRPTMC_REPORTCONFIG', 'FID', '1';

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


 EXEC P_ALTERPK 'PK_HRPTMC_REPORTMANAGE', 'T_HRPTMC_REPORTMANAGE', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_HRPTMC_REPORTMANAGE') CREATE INDEX IDX_HRPTMC_REPORTMANAGE ON T_HRPTMC_REPORTMANAGE ( FNUMBER ,FCLOUDID );


 EXEC P_ALTERPK 'PK_HRPTMC_REPORTMANAGE_L', 'T_HRPTMC_REPORTMANAGE_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_HRPTMC_ROWFIELD', 'T_HRPTMC_ROWFIELD', 'FID', '1';

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


 EXEC P_ALTERPK 'PK_HRPTMC_ROWFIELD_L', 'T_HRPTMC_ROWFIELD_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_HRPTMC_SUBTOTRFIELDREF', 'T_HRPTMC_SUBTOTRFIELDREF', 'FPKID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_HRPTMC_SUBTOTALROWFIELDREF') CREATE INDEX IDX_HRPTMC_SUBTOTALROWFIELDREF ON T_HRPTMC_SUBTOTRFIELDREF ( FID );


 EXEC P_ALTERPK 'PK_HRPTMC_ANALYSISOBJECT', 'T_HRPTMC_ANALYSISOBJECT', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_HRPTMC_ANALYSISOBJECT') CREATE INDEX IDX_HRPTMC_ANALYSISOBJECT ON T_HRPTMC_ANALYSISOBJECT ( FNUMBER );



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