Description:
im try sync 4 times but no change at my DB
i think this cause MYSQL WB cant sync FOREIGN KEY
MYSQL SERVER version 5.6.11
MYSQL WB 6.1.6
How to repeat:
just load my mysqlwb file and sql file
query LOG
SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0;
SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;
SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='TRADITIONAL,ALLOW_INVALID_DATES';
ALTER TABLE `pore`.`MASTER_PELANGGAN`
DROP FOREIGN KEY `MASTER_PELANGGAN_KODE_HARGA`;
ALTER TABLE `pore`.`MASTER_KODE`
DROP FOREIGN KEY `MASTER_KODE_KODE_DIVISI`,
DROP FOREIGN KEY `MASTER_KODE_KODE_NAMA`,
DROP FOREIGN KEY `MASTER_KODE_KODE_SATUAN`,
DROP FOREIGN KEY `MASTER_KODE_KODE_STOK`,
DROP FOREIGN KEY `MASTER_KODE_KODE_TIPE`;
ALTER TABLE `pore`.`MASTER_BARANG`
DROP FOREIGN KEY `MASTER_BARANG_KODE_MASTER`,
DROP FOREIGN KEY `MASTER_BARANG_KODE_MEREK`,
DROP FOREIGN KEY `MASTER_BARANG_KODE_PEMASOK`;
ALTER TABLE `pore`.`MASTER_USER`
DROP FOREIGN KEY `MASTER_STATUS_KODE_STATUS`;
ALTER TABLE `pore`.`UTANG_DALAM`
DROP FOREIGN KEY `UTANG_DALAM_KODE_PEMASOK`,
DROP FOREIGN KEY `UTANG_DALAM_KODE_SATUAN`;
ALTER TABLE `pore`.`PIUTANG_TEMP`
DROP FOREIGN KEY `PIUTANG_TEMP_KODE_MASTER`,
DROP FOREIGN KEY `PIUTANG_TEMP_KODE_MEREK`,
DROP FOREIGN KEY `PIUTANG_TEMP_KODE_SATUAN`;
ALTER TABLE `pore`.`PIUTANG`
DROP FOREIGN KEY `PIUTANG_KODE_MASTER`,
DROP FOREIGN KEY `PIUTANG_KODE_MEREK`,
DROP FOREIGN KEY `PIUTANG_KODE_SATUAN`;
ALTER TABLE `pore`.`UTANG_LUAR`
DROP FOREIGN KEY `UTANG_LUAR_KODE_MASTER`,
DROP FOREIGN KEY `UTANG_LUAR_KODE_MEREK`;
ALTER TABLE `pore`.`PESAN`
DROP FOREIGN KEY `PESAN_KODE_MASTER`;
ALTER TABLE `pore`.`CASH`
DROP FOREIGN KEY `CASH_KODE_MASTER`,
DROP FOREIGN KEY `CASH_KODE_MEREK`;
ALTER TABLE `pore`.`CASH_SEMENTARA`
DROP FOREIGN KEY `CASH_SEMENTARA_KODE_MASTER`,
DROP FOREIGN KEY `CASH_SEMENTARA_KODE_MEREK`;
ALTER TABLE `pore`.`MASTER_PELANGGAN`
ADD CONSTRAINT `MASTER_PELANGGAN_KODE_HARGA`
FOREIGN KEY (`KODE_HARGA`)
REFERENCES `pore`.`MASTER_HARGA` (`KODE_HARGA`)
ON DELETE RESTRICT
ON UPDATE CASCADE;
ALTER TABLE `pore`.`MASTER_KODE`
ADD CONSTRAINT `MASTER_KODE_KODE_DIVISI`
FOREIGN KEY (`KODE_DIVISI`)
REFERENCES `pore`.`MASTER_DIVISI` (`KODE_DIVISI`)
ON DELETE RESTRICT
ON UPDATE CASCADE,
ADD CONSTRAINT `MASTER_KODE_KODE_NAMA`
FOREIGN KEY (`KODE_NAMA`)
REFERENCES `pore`.`MASTER_NAMA` (`KODE_NAMA`)
ON DELETE RESTRICT
ON UPDATE CASCADE,
ADD CONSTRAINT `MASTER_KODE_KODE_SATUAN`
FOREIGN KEY (`KODE_SATUAN`)
REFERENCES `pore`.`MASTER_SATUAN` (`KODE_SATUAN`)
ON DELETE RESTRICT
ON UPDATE CASCADE,
ADD CONSTRAINT `MASTER_KODE_KODE_STOK`
FOREIGN KEY (`KODE_STOK`)
REFERENCES `pore`.`MASTER_STOK` (`KODE_STOK`)
ON DELETE RESTRICT
ON UPDATE CASCADE,
ADD CONSTRAINT `MASTER_KODE_KODE_TIPE`
FOREIGN KEY (`KODE_TIPE`)
REFERENCES `pore`.`MASTER_TIPE` (`KODE_TIPE`)
ON DELETE RESTRICT
ON UPDATE CASCADE;
ALTER TABLE `pore`.`MASTER_BARANG`
DROP FOREIGN KEY `MASTER_BARANG_KODE_GRUP`;
ALTER TABLE `pore`.`MASTER_BARANG` ADD CONSTRAINT `MASTER_BARANG_KODE_MASTER`
FOREIGN KEY (`KODE_MASTER`)
REFERENCES `pore`.`MASTER_KODE` (`KODE_MASTER`)
ON DELETE RESTRICT
ON UPDATE CASCADE,
ADD CONSTRAINT `MASTER_BARANG_KODE_MEREK`
FOREIGN KEY (`KODE_MEREK`)
REFERENCES `pore`.`MASTER_MEREK` (`KODE_MEREK`)
ON DELETE RESTRICT
ON UPDATE CASCADE,
ADD CONSTRAINT `MASTER_BARANG_KODE_PEMASOK`
FOREIGN KEY (`KODE_PEMASOK`)
REFERENCES `pore`.`MASTER_PEMASOK` (`KODE_PEMASOK`)
ON DELETE RESTRICT
ON UPDATE CASCADE,
ADD CONSTRAINT `MASTER_BARANG_KODE_GRUP`
FOREIGN KEY (`KODE_GRUP`)
REFERENCES `pore`.`MASTER_GRUP` (`KODE_GRUP`)
ON DELETE RESTRICT
ON UPDATE CASCADE;
ALTER TABLE `pore`.`MASTER_USER`
ADD CONSTRAINT `MASTER_STATUS_KODE_STATUS`
FOREIGN KEY (`KODE_STATUS`)
REFERENCES `pore`.`MASTER_STATUS` (`KODE_STATUS`)
ON DELETE RESTRICT
ON UPDATE CASCADE;
ALTER TABLE `pore`.`UTANG_DALAM`
ADD CONSTRAINT `UTANG_DALAM_KODE_PEMASOK`
FOREIGN KEY (`KODE_PEMASOK`)
REFERENCES `pore`.`MASTER_PEMASOK` (`KODE_PEMASOK`)
ON DELETE RESTRICT
ON UPDATE CASCADE,
ADD CONSTRAINT `UTANG_DALAM_KODE_SATUAN`
FOREIGN KEY (`KODE_SATUAN`)
REFERENCES `pore`.`MASTER_SATUAN` (`KODE_SATUAN`)
ON DELETE RESTRICT
ON UPDATE CASCADE;
ALTER TABLE `pore`.`PIUTANG_TEMP`
DROP FOREIGN KEY `PIUTANG_TEMP_KODE_PELANGGAN`,
DROP FOREIGN KEY `PIUTANG_TEMP_KODE_PEMASOK`,
DROP FOREIGN KEY `PIUTANG_TEMP_KODE_GRUP`;
ALTER TABLE `pore`.`PIUTANG_TEMP` ADD CONSTRAINT `PIUTANG_TEMP_KODE_PELANGGAN`
FOREIGN KEY (`KODE_PELANGGAN`)
REFERENCES `pore`.`MASTER_PELANGGAN` (`KODE_PELANGGAN`)
ON DELETE RESTRICT
ON UPDATE CASCADE,
ADD CONSTRAINT `PIUTANG_TEMP_KODE_MASTER`
FOREIGN KEY (`KODE_MASTER`)
REFERENCES `pore`.`MASTER_KODE` (`KODE_MASTER`)
ON DELETE RESTRICT
ON UPDATE CASCADE,
ADD CONSTRAINT `PIUTANG_TEMP_KODE_PEMASOK`
FOREIGN KEY (`KODE_PEMASOK`)
REFERENCES `pore`.`MASTER_PEMASOK` (`KODE_PEMASOK`)
ON DELETE RESTRICT
ON UPDATE CASCADE,
ADD CONSTRAINT `PIUTANG_TEMP_KODE_MEREK`
FOREIGN KEY (`KODE_MEREK`)
REFERENCES `pore`.`MASTER_MEREK` (`KODE_MEREK`)
ON DELETE RESTRICT
ON UPDATE CASCADE,
ADD CONSTRAINT `PIUTANG_TEMP_KODE_SATUAN`
FOREIGN KEY (`KODE_SATUAN`)
REFERENCES `pore`.`MASTER_SATUAN` (`KODE_SATUAN`)
ON DELETE RESTRICT
ON UPDATE CASCADE,
ADD CONSTRAINT `PIUTANG_TEMP_KODE_GRUP`
FOREIGN KEY (`KODE_GRUP`)
REFERENCES `pore`.`MASTER_GRUP` (`KODE_GRUP`)
ON DELETE RESTRICT
ON UPDATE CASCADE;
ALTER TABLE `pore`.`PIUTANG`
DROP FOREIGN KEY `PIUTANG_KODE_PELANGGAN`,
DROP FOREIGN KEY `PIUTANG_KODE_PEMASOK`,
DROP FOREIGN KEY `PIUTANG_KODE_GRUP`;
ALTER TABLE `pore`.`PIUTANG` ADD CONSTRAINT `PIUTANG_KODE_PELANGGAN`
FOREIGN KEY (`KODE_PELANGGAN`)
REFERENCES `pore`.`MASTER_PELANGGAN` (`KODE_PELANGGAN`)
ON DELETE RESTRICT
ON UPDATE CASCADE,
ADD CONSTRAINT `PIUTANG_KODE_MASTER`
FOREIGN KEY (`KODE_MASTER`)
REFERENCES `pore`.`MASTER_KODE` (`KODE_MASTER`)
ON DELETE RESTRICT
ON UPDATE CASCADE,
ADD CONSTRAINT `PIUTANG_KODE_PEMASOK`
FOREIGN KEY (`KODE_PEMASOK`)
REFERENCES `pore`.`MASTER_PEMASOK` (`KODE_PEMASOK`)
ON DELETE RESTRICT
ON UPDATE CASCADE,
ADD CONSTRAINT `PIUTANG_KODE_MEREK`
FOREIGN KEY (`KODE_MEREK`)
REFERENCES `pore`.`MASTER_MEREK` (`KODE_MEREK`)
ON DELETE RESTRICT
ON UPDATE CASCADE,
ADD CONSTRAINT `PIUTANG_KODE_SATUAN`
FOREIGN KEY (`KODE_SATUAN`)
REFERENCES `pore`.`MASTER_SATUAN` (`KODE_SATUAN`)
ON DELETE RESTRICT
ON UPDATE CASCADE,
ADD CONSTRAINT `PIUTANG_KODE_GRUP`
FOREIGN KEY (`KODE_GRUP`)
REFERENCES `pore`.`MASTER_GRUP` (`KODE_GRUP`)
ON DELETE RESTRICT
ON UPDATE CASCADE;
ALTER TABLE `pore`.`UTANG_LUAR`
DROP FOREIGN KEY `UTANG_LUAR_KODE_PEMASOK`;
ALTER TABLE `pore`.`UTANG_LUAR` ADD CONSTRAINT `UTANG_LUAR_KODE_MASTER`
FOREIGN KEY (`KODE_MASTER`)
REFERENCES `pore`.`MASTER_KODE` (`KODE_MASTER`)
ON DELETE RESTRICT
ON UPDATE CASCADE,
ADD CONSTRAINT `UTANG_LUAR_KODE_PEMASOK`
FOREIGN KEY (`KODE_PEMASOK`)
REFERENCES `pore`.`MASTER_PEMASOK` (`KODE_PEMASOK`)
ON DELETE RESTRICT
ON UPDATE CASCADE,
ADD CONSTRAINT `UTANG_LUAR_KODE_MEREK`
FOREIGN KEY (`KODE_MEREK`)
REFERENCES `pore`.`MASTER_MEREK` (`KODE_MEREK`)
ON DELETE RESTRICT
ON UPDATE CASCADE;
ALTER TABLE `pore`.`PESAN`
DROP FOREIGN KEY `PESAN_KODE_PEMASOK`,
DROP FOREIGN KEY `PESAN_KODE_MEREK`;
ALTER TABLE `pore`.`PESAN` ADD CONSTRAINT `PESAN_KODE_PEMASOK`
FOREIGN KEY (`KODE_PEMASOK`)
REFERENCES `pore`.`MASTER_PEMASOK` (`KODE_PEMASOK`)
ON DELETE RESTRICT
ON UPDATE CASCADE,
ADD CONSTRAINT `PESAN_KODE_MEREK`
FOREIGN KEY (`KODE_MEREK`)
REFERENCES `pore`.`MASTER_MEREK` (`KODE_MEREK`)
ON DELETE RESTRICT
ON UPDATE CASCADE,
ADD CONSTRAINT `PESAN_KODE_MASTER`
FOREIGN KEY (`KODE_MASTER`)
REFERENCES `pore`.`MASTER_KODE` (`KODE_MASTER`)
ON DELETE RESTRICT
ON UPDATE CASCADE;
ALTER TABLE `pore`.`CASH`
DROP FOREIGN KEY `CASH_KODE_PEMASOK`,
DROP FOREIGN KEY `CASH_KODE_GRUP`;
ALTER TABLE `pore`.`CASH` ADD CONSTRAINT `CASH_KODE_MASTER`
FOREIGN KEY (`KODE_MASTER`)
REFERENCES `pore`.`MASTER_KODE` (`KODE_MASTER`)
ON DELETE RESTRICT
ON UPDATE CASCADE,
ADD CONSTRAINT `CASH_KODE_PEMASOK`
FOREIGN KEY (`KODE_PEMASOK`)
REFERENCES `pore`.`MASTER_PEMASOK` (`KODE_PEMASOK`)
ON DELETE RESTRICT
ON UPDATE CASCADE,
ADD CONSTRAINT `CASH_KODE_MEREK`
FOREIGN KEY (`KODE_MEREK`)
REFERENCES `pore`.`MASTER_MEREK` (`KODE_MEREK`)
ON DELETE RESTRICT
ON UPDATE CASCADE,
ADD CONSTRAINT `CASH_KODE_GRUP`
FOREIGN KEY (`KODE_GRUP`)
REFERENCES `pore`.`MASTER_GRUP` (`KODE_GRUP`)
ON DELETE RESTRICT
ON UPDATE CASCADE;
ALTER TABLE `pore`.`CASH_SEMENTARA`
DROP FOREIGN KEY `CASH_SEMENTARA_KODE_PEMASOK`,
DROP FOREIGN KEY `CASH_SEMENTARA_KODE_GRUP`;
ALTER TABLE `pore`.`CASH_SEMENTARA` ADD CONSTRAINT `CASH_SEMENTARA_KODE_MASTER`
FOREIGN KEY (`KODE_MASTER`)
REFERENCES `pore`.`MASTER_KODE` (`KODE_MASTER`)
ON DELETE RESTRICT
ON UPDATE CASCADE,
ADD CONSTRAINT `CASH_SEMENTARA_KODE_PEMASOK`
FOREIGN KEY (`KODE_PEMASOK`)
REFERENCES `pore`.`MASTER_PEMASOK` (`KODE_PEMASOK`)
ON DELETE RESTRICT
ON UPDATE CASCADE,
ADD CONSTRAINT `CASH_SEMENTARA_KODE_MEREK`
FOREIGN KEY (`KODE_MEREK`)
REFERENCES `pore`.`MASTER_MEREK` (`KODE_MEREK`)
ON DELETE RESTRICT
ON UPDATE CASCADE,
ADD CONSTRAINT `CASH_SEMENTARA_KODE_GRUP`
FOREIGN KEY (`KODE_GRUP`)
REFERENCES `pore`.`MASTER_GRUP` (`KODE_GRUP`)
ON DELETE RESTRICT
ON UPDATE CASCADE;
SET SQL_MODE=@OLD_SQL_MODE;
SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS;
SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS;