/**Begin D:\tools\PDM_UPGRADE\PDM1\HIES_constraint.sql **/
 EXEC P_ALTERPK 'PK_HIES_VIRENTITYCFG', 'T_HIES_VIRENTITYCFG', 'FID', '1';

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


 EXEC P_ALTERPK 'PK_HIES_VIRENTITYCFG_L', 'T_HIES_VIRENTITYCFG_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_HIES_VIROBJENTITYREL', 'T_HIES_VIROBJENTITYREL', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_HIES_VIROBJENTITYREL_VID') CREATE INDEX IDX_HIES_VIROBJENTITYREL_VID ON T_HIES_VIROBJENTITYREL ( FVIRENTITYCFGID );


 EXEC P_ALTERPK 'PK_HIES_VIROBJJOINCOND', 'T_HIES_VIROBJJOINCOND', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_HIES_VIROBJJOINENTITY', 'T_HIES_VIROBJJOINENTITY', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_HIES_VIROBJJOINENTITY_VID') CREATE INDEX IDX_HIES_VIROBJJOINENTITY_VID ON T_HIES_VIROBJJOINENTITY ( FVIRENTITYCFGID );


 EXEC P_ALTERPK 'PK_HIES_VIROBJJOINENTITY_L', 'T_HIES_VIROBJJOINENTITY_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_HIES_VIROBJQUERYFIELD', 'T_HIES_VIROBJQUERYFIELD', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_HIES_VIROBJQUERYFIELD_VID') CREATE INDEX IDX_HIES_VIROBJQUERYFIELD_VID ON T_HIES_VIROBJQUERYFIELD ( FVIRENTITYCFGID );


 EXEC P_ALTERPK 'PK_HIES_VIROBJQUERYFIELD_L', 'T_HIES_VIROBJQUERYFIELD_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_HIES_HRVIRENTITYREG', 'T_HIES_HRVIRENTITYREG', 'FID', '1';

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


 EXEC P_ALTERPK 'PK_HIES_HRVIRENTITYREG_L', 'T_HIES_HRVIRENTITYREG_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_HIES_HRVIRENTITYREL', 'T_HIES_HRVIRENTITYREL', 'FENTRYID', '1';

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

/**End D:\tools\PDM_UPGRADE\PDM1\HIES_constraint.sql **/
