salix/db/versions/.archive/10727-limeErica/07-AddFieldsToPackingSite.sql

15 lines
988 B
MySQL
Raw Permalink Normal View History

ALTER TABLE vn.packingSite ADD printerRfidFk TINYINT(3) UNSIGNED DEFAULT NULL NULL UNIQUE AFTER hostFk;
ALTER TABLE vn.packingSite ADD scannerFk INT(11) NULL UNIQUE;
ALTER TABLE vn.packingSite ADD screenFk INT(11) NULL UNIQUE;
ALTER TABLE vn.packingSite ADD editorFk INT(10) UNSIGNED NULL;
ALTER TABLE vn.packingSite ADD CONSTRAINT packingSite_FK_4 FOREIGN KEY (printerRfidFk) REFERENCES vn.printer(id) ON UPDATE CASCADE;
ALTER TABLE vn.packingSite ADD CONSTRAINT packingSite_FK_5 FOREIGN KEY (scannerFk) REFERENCES vn.scanner(id) ON UPDATE CASCADE;
ALTER TABLE vn.packingSite ADD CONSTRAINT packingSite_FK_6 FOREIGN KEY (screenFk) REFERENCES vn.screen(id) ON UPDATE CASCADE;
ALTER TABLE vn.packingSite CHANGE collectionFk collectionFk int(11) DEFAULT NULL NULL COMMENT 'Last collection packed on this site';
ALTER TABLE vn.packingSite ADD CONSTRAINT packingSite_UNI UNIQUE KEY (hostFk);
UPDATE vn.packingSite SET printerRfidFk = printerFk;
UPDATE vn.packingSite SET printerFk = NULL;