salix/db/versions/.archive/10436-tealPalmetto/00-createFkWorker.sql

4 lines
254 B
SQL

ALTER TABLE vn.saleTracking MODIFY COLUMN workerFk int(10) unsigned NOT NULL;
DELETE FROM vn.saleTracking WHERE workerFk = 0;
ALTER TABLE vn.saleTracking ADD CONSTRAINT saleTracking_FK_2 FOREIGN KEY (workerFk) REFERENCES vn.worker(id) ON UPDATE CASCADE;