/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\BASE_constraint.sql **/
EXEC p_DropIdx 'IX_BD_MATCTEN_FSUBELETID', 'T_BD_MATCOSTINFOENTRY';
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IX_BD_MATCTEN_FSUBELETID') CREATE INDEX IX_BD_MATCTEN_FSUBELETID ON T_BD_MATCOSTINFOENTRY ( FID ,FELEMENTID ,FSUBELEMENTID );

 EXEC P_ALTERPK 'PK_T_BD_PROPERTYCONFIG', 'T_BD_PROPERTYCONFIG', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BD_PROPERTYCONFIG_TARGETOB') CREATE INDEX IDX_BD_PROPERTYCONFIG_TARGETOB ON T_BD_PROPERTYCONFIG ( FTARGETOBJ );


 EXEC P_ALTERPK 'PK_T_BD_PROPERTYCONFIG_L', 'T_BD_PROPERTYCONFIG_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_T_BD_PROPERTYCONFIGINFO', 'T_BD_PROPERTYCONFIGINFO', 'FENTRYID', '1';

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


 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BD_CUSTOMER_L_NAME') CREATE INDEX IDX_BD_CUSTOMER_L_NAME ON T_BD_CUSTOMER_L ( FNAME );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BD_SUPPLIER_L_NAME') CREATE INDEX IDX_BD_SUPPLIER_L_NAME ON T_BD_SUPPLIER_L ( FNAME );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_T_BD_CUSTOMER_TYPE') CREATE INDEX IDX_T_BD_CUSTOMER_TYPE ON T_BD_CUSTOMER ( FTYPE );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_T_BD_SUPPLIER_TYPE') CREATE INDEX IDX_T_BD_SUPPLIER_TYPE ON T_BD_SUPPLIER ( FTYPE );


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