salix/db/versions/11383-maroonChico/00-town.sql

11 lines
247 B
MySQL
Raw Normal View History

2024-12-13 12:49:35 +00:00
UPDATE vn.town t
LEFT JOIN vn.zoneGeo zg ON zg.id = t.geoFk
SET t.geoFk = NULL
WHERE zg.id IS NULL;
ALTER TABLE vn.town
ADD CONSTRAINT town_zoneGeo_FK FOREIGN KEY (geoFk)
REFERENCES vn.zoneGeo(id)
ON DELETE RESTRICT
ON UPDATE CASCADE;