/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\EB_constraint.sql **/
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_EB_CENTRALIZED_P1') CREATE INDEX IDX_EB_CENTRALIZED_P1 ON T_EB_CENTRALIZED_ENTITY ( FDIMENSION );

 EXEC P_ALTERPK 'PK_T_EB_EXAMINE_DIMSET', 'T_EB_EXAMINE_DIMSET', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_T_EB_CHANGETYPEFORMULA', 'T_EB_CHANGETYPEFORMULA', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_T_EB_MEMBERSAVESELECT', 'T_EB_MEMBERSAVESELECT', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_EB_MEMBERSAVESELECT_P1') CREATE INDEX IDX_EB_MEMBERSAVESELECT_P1 ON T_EB_MEMBERSAVESELECT ( FMEMBERID );


 EXEC P_ALTERPK 'PK_T_EB_BIZRULEOPTIMIZE', 'T_EB_BIZRULEOPTIMIZE', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_EB_BIZRULEOPTIMIZE_P1') CREATE UNIQUE INDEX IDX_EB_BIZRULEOPTIMIZE_P1 ON T_EB_BIZRULEOPTIMIZE ( FMODELID );

 EXEC P_ALTERPK 'PK_EB_CENTRALIZED_ENTITY_L', 'T_EB_CENTRALIZED_ENTITY_L', 'FPKID', '1';
 
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_EB_CENTR_ENTRY_L') CREATE INDEX IDX_EB_CENTR_ENTRY_L ON T_EB_CENTRALIZED_ENTITY_L ( FID ,FLOCALEID );

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