8144-devToTest_2448 #3216

Merged
alexm merged 256 commits from 8144-devToTest_2448 into test 2024-11-19 07:36:04 +00:00
3 changed files with 9 additions and 9 deletions
Showing only changes of commit aed4bc89c7 - Show all commits

View File

@ -3,7 +3,7 @@ ALTER TABLE vn.address
ADD CONSTRAINT address_zoneGeo_FK FOREIGN KEY (geoFk)
REFERENCES vn.zoneGeo(id) ON DELETE RESTRICT ON UPDATE CASCADE;
CREATE OR REPLACE TEMPORARY TABLE tAddressGeo
CREATE OR REPLACE TEMPORARY TABLE tmp.tAddressGeo
(PRIMARY KEY (id))
ENGINE = MEMORY
SELECT a.id, p.geoFk
@ -15,7 +15,7 @@ CREATE OR REPLACE TEMPORARY TABLE tAddressGeo
(p.code = a.postalCode) DESC;
UPDATE address a
JOIN tAddressGeo tag ON tag.id = a.id
JOIN tmp.tAddressGeo tag ON tag.id = a.id
SET a.geoFk = tag.geoFk;
DROP TEMPORARY TABLE tAddressGeo;
DROP TEMPORARY TABLE tmp.tAddressGeo;

View File

@ -6,7 +6,7 @@ ALTER TABLE vn.client
ADD CONSTRAINT client_zoneGeo_FK FOREIGN KEY (geoFk)
REFERENCES vn.zoneGeo(id) ON DELETE RESTRICT ON UPDATE CASCADE;
CREATE OR REPLACE TEMPORARY TABLE tClientGeo
CREATE OR REPLACE TEMPORARY TABLE tmp.tClientGeo
(PRIMARY KEY (id))
ENGINE = MEMORY
SELECT c.id, p.geoFk
@ -18,7 +18,7 @@ CREATE OR REPLACE TEMPORARY TABLE tClientGeo
(p.code = c.postcode) DESC;
UPDATE client c
JOIN tClientGeo tcg ON tcg.id = c.id
JOIN tmp.tClientGeo tcg ON tcg.id = c.id
SET c.geoFk = tcg.geoFk;
DROP TEMPORARY TABLE tClientGeo;
DROP TEMPORARY TABLE tmp.tClientGeo;

View File

@ -5,7 +5,7 @@ ALTER TABLE vn.supplier
ADD CONSTRAINT supplier_zoneGeo_FK FOREIGN KEY (geoFk)
REFERENCES vn.zoneGeo(id) ON DELETE RESTRICT ON UPDATE CASCADE;
CREATE OR REPLACE TEMPORARY TABLE tSupplierGeo
CREATE OR REPLACE TEMPORARY TABLE tmp.tSupplierGeo
(PRIMARY KEY (id))
ENGINE = MEMORY
SELECT s.id, p.geoFk
@ -19,7 +19,7 @@ CREATE OR REPLACE TEMPORARY TABLE tSupplierGeo
(p.code = sad.postalCode) DESC;
UPDATE supplier s
JOIN tSupplierGeo tsg ON tsg.id = s.id
JOIN tmp.tSupplierGeo tsg ON tsg.id = s.id
SET s.geoFk = tsg.geoFk;
DROP TEMPORARY TABLE tSupplierGeo;
DROP TEMPORARY TABLE tmp.tSupplierGeo;