From 80fc3235e9b5dd9dc2b44b58d9a2a3b172b952ce Mon Sep 17 00:00:00 2001 From: robert Date: Wed, 8 Jan 2025 13:27:23 +0100 Subject: [PATCH] feat: refs #7731 changes request --- db/versions/11303-salmonMoss/00-firstScript.sql | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/db/versions/11303-salmonMoss/00-firstScript.sql b/db/versions/11303-salmonMoss/00-firstScript.sql index ac0750d12..6c5a8b7cc 100644 --- a/db/versions/11303-salmonMoss/00-firstScript.sql +++ b/db/versions/11303-salmonMoss/00-firstScript.sql @@ -8,14 +8,16 @@ ALTER TABLE vn.supplier -- client UPDATE vn.client c JOIN country c2 ON c2.id = c.countryFk - SET c.viesCode = c2.code; + SET c.viesCode = c2.code + WHERE c.isVies; UPDATE client c - JOIN country c2 ON c2.id = c.countryFk + JOIN country c2 ON c2.id = c.countryFk SET c.viesCode = 'FR' - WHERE c2.name = 'Mónaco'; + WHERE c2.name = 'Mónaco' AND c.isVies; -- supplier UPDATE supplier s - JOIN country c ON c.id = s.countryFk -SET s.viesCode = c.code; + JOIN country c ON c.id = s.countryFk + SET s.viesCode = c.code + WHERE s.isVies;