salix/db/versions/.archive/10301-4415collectionNewPAK/02-collection.sql

9 lines
281 B
SQL

ALTER TABLE vn.collection ADD IF NOT EXISTS sectorFk INT NULL;
ALTER TABLE vn.collection ADD IF NOT EXISTS wagons INT NULL;
ALTER TABLE vn.collection
ADD CONSTRAINT collectionSector_FK
FOREIGN KEY (sectorFk)
REFERENCES vn.sector(id)
ON DELETE SET NULL
ON UPDATE CASCADE;