/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\EB_constraint.sql **/
 EXEC P_ALTERPK 'PK_T_EB_INTEGRATION_MAPVAL', 'T_EB_INTEGRATION_MAPVAL', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_T_EB_INTEGRATION_MAP', 'T_EB_INTEGRATION_MAP', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_MAP_MAPCAT_P1') CREATE INDEX IDX_MAP_MAPCAT_P1 ON T_EB_INTEGRATION_MAP ( FMAPCAT );


 EXEC P_ALTERPK 'PK_T_EB_INTEGRATION_MAPCAT', 'T_EB_INTEGRATION_MAPCAT', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_EB_MAPCAT_P1') CREATE INDEX IDX_EB_MAPCAT_P1 ON T_EB_INTEGRATION_MAPCAT ( FMODELID );


 EXEC P_ALTERPK 'PK_T_EB_INTEGRATION_MAPM', 'T_EB_INTEGRATION_MAPM', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_T_EB_INTEGRATION_MAPDIM', 'T_EB_INTEGRATION_MAPDIM', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_T_EB_INTEGRATION_ROUTER', 'T_EB_INTEGRATION_ROUTER', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_EB_ING_ROUTER_MODEL') CREATE INDEX IDX_EB_ING_ROUTER_MODEL ON T_EB_INTEGRATION_ROUTER ( FMODELID );


 EXEC P_ALTERPK 'PK_T_EB_INTEGRATION', 'T_EB_INTEGRATION', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_EB_INTEGRATION_P1') CREATE INDEX IDX_EB_INTEGRATION_P1 ON T_EB_INTEGRATION ( FDATASETID );


 EXEC P_ALTERPK 'PK_T_EB_BIZRULESET_ENTRY', 'T_EB_BIZRULESET_ENTRY', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_T_EB_BROADCASE_L', 'T_EB_BROADCASE_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_T_EB_BROADCASTMAPPING', 'T_EB_BROADCASTMAPPING', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_T_EB_BROADCASE', 'T_EB_BROADCASE', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_EB_BROADCASE_P1') CREATE INDEX IDX_EB_BROADCASE_P1 ON T_EB_BROADCASE ( FMODELID );



/**End E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\EB_constraint.sql **/
