refs #6965 Add Fk vehicleFk firstEditorFk #2433
|
@ -0,0 +1,16 @@
|
||||||
|
UPDATE vn.route
|
||||||
|
SET vehicleFk = NULL
|
||||||
|
WHERE vehicleFk NOT IN (SELECT id FROM vn.vehicle);
|
||||||
|
|
||||||
|
ALTER TABLE vn.route
|
||||||
|
ADD CONSTRAINT route_vehicleFk FOREIGN KEY (vehicleFk) REFERENCES vn.vehicle(id);
|
||||||
|
|
||||||
|
ALTER TABLE vn.route
|
||||||
|
MODIFY COLUMN firstEditorFk int(10) unsigned NULL;
|
||||||
|
|
||||||
|
UPDATE vn.route
|
||||||
|
SET firstEditorFk = NULL
|
||||||
|
WHERE firstEditorFk NOT IN (SELECT id FROM account.user);
|
||||||
ivanm marked this conversation as resolved
Outdated
|
|||||||
|
|
||||||
|
ALTER TABLE vn.route
|
||||||
|
ADD CONSTRAINT route_firstEditorFk FOREIGN KEY (firstEditorFk) REFERENCES account.user(id);
|
Loading…
Reference in New Issue
Apuntar a account.user en vez de a vn.worker