/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\BOS_constraint.sql **/

 EXEC P_ALTERPK 'PK_T_BD_COUNTRY_PRESET_L', 'T_BD_COUNTRY_PRESET_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_BD_ADMINDIVISIONPRE', 'T_BD_ADMINDIVISIONPRE', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BD_ADMINPRE_COUNRYNUM') CREATE INDEX IDX_BD_ADMINPRE_COUNRYNUM ON T_BD_ADMINDIVISIONPRE ( FNUMBER ,FCOUNTRYID );


 EXEC P_ALTERPK 'PK_BD_ADMINDIVISIONPRE_L', 'T_BD_ADMINDIVISIONPRE_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_BD_COUNTRY_PRESET', 'T_BD_COUNTRY_PRESET', 'FID', '1';

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


 EXEC P_ALTERPK 'PK_BD_PRESET_VERSION', 'T_BD_PRESET_VERSION', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BD_PRESETVER_SOURCE') CREATE INDEX IDX_BD_PRESETVER_SOURCE ON T_BD_PRESET_VERSION ( FSOURCE );


 EXEC P_ALTERPK 'PK_BD_PRESET_VERSION_L', 'T_BD_PRESET_VERSION_L', 'FPKID', '1';

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



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