salix/db/versions/.archive/10727-limeErica/06-alterTablePrinterModel.sql

9 lines
634 B
MySQL
Raw Normal View History

ALTER TABLE vn.printer DROP FOREIGN KEY IF EXISTS printer_FK;
ALTER TABLE vn.packingSiteLog DROP FOREIGN KEY IF EXISTS packingSiteLog_FK_1;
ALTER TABLE vn.printerModel ADD CONSTRAINT printerModel_PK PRIMARY KEY IF NOT EXISTS (code);
ALTER TABLE vn.printerModel DROP KEY IF EXISTS printerModel_UN;
ALTER TABLE vn.printer ADD CONSTRAINT printer_FK FOREIGN KEY IF NOT EXISTS (modelFk) REFERENCES vn.printerModel(code) ON DELETE RESTRICT ON UPDATE CASCADE;
ALTER TABLE vn.packingSiteLog ADD CONSTRAINT packingSiteLog_FK_1 FOREIGN KEY IF NOT EXISTS (printerModelFk) REFERENCES vn.printerModel(code) ON DELETE RESTRICT ON UPDATE CASCADE;