feat: refs #8057 Fix version
gitea/salix/pipeline/head There was a failure building this commit Details

This commit is contained in:
Guillermo Bonet 2024-11-18 12:56:37 +01:00
parent aed4bc89c7
commit 2b770c0201
3 changed files with 13 additions and 13 deletions

View File

@ -7,14 +7,14 @@ CREATE OR REPLACE TEMPORARY TABLE tmp.tAddressGeo
(PRIMARY KEY (id)) (PRIMARY KEY (id))
ENGINE = MEMORY ENGINE = MEMORY
SELECT a.id, p.geoFk SELECT a.id, p.geoFk
FROM address a FROM vn.address a
JOIN town t ON t.provinceFk = a.provinceFk JOIN vn.town t ON t.provinceFk = a.provinceFk
JOIN postCode p ON p.townFk = t.id JOIN vn.postCode p ON p.townFk = t.id
GROUP BY a.id GROUP BY a.id
ORDER BY (a.city SOUNDS LIKE t.`name`) DESC, ORDER BY (a.city SOUNDS LIKE t.`name`) DESC,
(p.code = a.postalCode) DESC; (p.code = a.postalCode) DESC;
UPDATE address a UPDATE vn.address a
JOIN tmp.tAddressGeo tag ON tag.id = a.id JOIN tmp.tAddressGeo tag ON tag.id = a.id
SET a.geoFk = tag.geoFk; SET a.geoFk = tag.geoFk;

View File

@ -10,14 +10,14 @@ CREATE OR REPLACE TEMPORARY TABLE tmp.tClientGeo
(PRIMARY KEY (id)) (PRIMARY KEY (id))
ENGINE = MEMORY ENGINE = MEMORY
SELECT c.id, p.geoFk SELECT c.id, p.geoFk
FROM client c FROM vn.client c
JOIN town t ON t.provinceFk = c.provinceFk JOIN vn.town t ON t.provinceFk = c.provinceFk
JOIN postCode p ON p.townFk = t.id JOIN vn.postCode p ON p.townFk = t.id
GROUP BY c.id GROUP BY c.id
ORDER BY (c.city SOUNDS LIKE t.`name`) DESC, ORDER BY (c.city SOUNDS LIKE t.`name`) DESC,
(p.code = c.postcode) DESC; (p.code = c.postcode) DESC;
UPDATE client c UPDATE vn.client c
JOIN tmp.tClientGeo tcg ON tcg.id = c.id JOIN tmp.tClientGeo tcg ON tcg.id = c.id
SET c.geoFk = tcg.geoFk; SET c.geoFk = tcg.geoFk;

View File

@ -9,16 +9,16 @@ CREATE OR REPLACE TEMPORARY TABLE tmp.tSupplierGeo
(PRIMARY KEY (id)) (PRIMARY KEY (id))
ENGINE = MEMORY ENGINE = MEMORY
SELECT s.id, p.geoFk SELECT s.id, p.geoFk
FROM supplier s FROM vn.supplier s
JOIN town t ON t.provinceFk = s.provinceFk JOIN vn.town t ON t.provinceFk = s.provinceFk
JOIN postCode p ON p.townFk = t.id JOIN vn.postCode p ON p.townFk = t.id
LEFT JOIN supplierAddress sad ON sad.supplierFk = s.id LEFT JOIN vn.supplierAddress sad ON sad.supplierFk = s.id
GROUP BY s.id GROUP BY s.id
ORDER BY (s.city SOUNDS LIKE t.`name`) DESC, ORDER BY (s.city SOUNDS LIKE t.`name`) DESC,
(p.code = s.postCode) DESC, (p.code = s.postCode) DESC,
(p.code = sad.postalCode) DESC; (p.code = sad.postalCode) DESC;
UPDATE supplier s UPDATE vn.supplier s
JOIN tmp.tSupplierGeo tsg ON tsg.id = s.id JOIN tmp.tSupplierGeo tsg ON tsg.id = s.id
SET s.geoFk = tsg.geoFk; SET s.geoFk = tsg.geoFk;