salix/db/versions/10812-goldenPaniculata/00-update.sql

9 lines
215 B
SQL

UPDATE IGNORE vn.dms
SET dmsTypeFk = (SELECT id FROM vn.dmsType WHERE code = 'vehicle')
WHERE id IN (
SELECT d.id
FROM vn.dms d
JOIN vn.dmsType dt ON dt.id = d.dmsTypeFk
WHERE dt.code = 'vehicles'
);