/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\EB_constraint.sql **/
 EXEC P_ALTERPK 'PK_T_EB_CUSTOMPROPERTY', 'T_EB_CUSTOMPROPERTY', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_EB_CUSTOMPROPERTY_P1') CREATE INDEX IDX_EB_CUSTOMPROPERTY_P1 ON T_EB_CUSTOMPROPERTY ( FDIMENSIONID );

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


 EXEC P_ALTERPK 'PK_T_EB_CUSTOMPROPERTYVALUE', 'T_EB_CUSTOMPROPERTYVALUE', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_EB_CUSPROVALUE_P1') CREATE INDEX IDX_EB_CUSPROVALUE_P1 ON T_EB_CUSTOMPROPERTYVALUE ( FPROPERTYID );


 EXEC P_ALTERPK 'PK_T_EB_RULEFUNCTION', 'T_EB_RULEFUNCTION', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_EB_RULEFUNCTION_P1') CREATE INDEX IDX_EB_RULEFUNCTION_P1 ON T_EB_RULEFUNCTION ( FRULEID );


 EXEC P_ALTERPK 'PK_T_EB_CUSTOMPROPERTY_L', 'T_EB_CUSTOMPROPERTY_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_T_EB_MEMBERPROPERTYVALUE', 'T_EB_MEMBERPROPERTYVALUE', 'FENTRYID', '1';

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



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