/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\BASE_constraint.sql **/
EXEC p_DropIdx 'IDX_BD_ BizPartnerUnitCode', 'T_BD_BIZPARTNERUNITCODE';
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BD_BIZPARTNERUNITCODE') CREATE INDEX IDX_BD_BIZPARTNERUNITCODE ON T_BD_BIZPARTNERUNITCODE ( FNUMBER );

EXEC p_DropIdx 'IDX_BD_ BizPartnerUnitCode_L_F', 'T_BD_BIZPARTNERUNITCODE_L';
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BD_BPUNITCODE_L_FID') CREATE INDEX IDX_BD_BPUNITCODE_L_FID ON T_BD_BIZPARTNERUNITCODE_L ( FID ,FLOCALEID );

EXEC p_DropIdx 'IDX_BD_ BizPartnerUnitCodeReg_', 'T_BD_BPUNITCODEREG';
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BD_BPUNITCODEREG_ENTRY') CREATE INDEX IDX_BD_BPUNITCODEREG_ENTRY ON T_BD_BPUNITCODEREG ( FID );

 EXEC P_ALTERPK 'PK_T_BD_BOMVERSION', 'T_BD_BOMVERSION', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BD_BOMVERSION') CREATE INDEX IDX_BD_BOMVERSION ON T_BD_BOMVERSION ( FNUMBER ,FCREATEORGID );


 EXEC P_ALTERPK 'PK_T_BD_BOMVERSION_L', 'T_BD_BOMVERSION_L', 'FPKID', '1';

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



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