refactor: refs #7920 itemShelvingLog
gitea/salix/pipeline/pr-dev This commit looks good Details

This commit is contained in:
Guillermo Bonet 2024-11-13 12:04:47 +01:00
parent 755312b981
commit 5a134668da
2 changed files with 17 additions and 3 deletions

View File

@ -3,14 +3,14 @@ CREATE OR REPLACE TEMPORARY TABLE tItemShelving
ENGINE = MEMORY ENGINE = MEMORY
SELECT ish.id, s.id shelvingFk SELECT ish.id, s.id shelvingFk
FROM shelving s FROM shelving s
JOIN itemShelving ish ON ish.shelvingFk = s.code; JOIN itemShelving ish ON ish.shelvingFk = s.code COLLATE utf8mb3_unicode_ci;
ALTER TABLE vn.itemShelving DROP FOREIGN KEY itemShelving_fk2, ALTER TABLE vn.itemShelving DROP FOREIGN KEY itemShelving_fk2,
MODIFY COLUMN shelvingFk int(11) NOT NULL; MODIFY COLUMN shelvingFk int(11) NOT NULL;
UPDATE itemShelving ish UPDATE itemShelving ish
JOIN tItemShelving tis ON tis.id = ish.id JOIN tItemShelving tish ON tish.id = ish.id
SET ish.shelvingFk = tis.shelvingFk; SET ish.shelvingFk = tish.shelvingFk;
DROP TEMPORARY TABLE tItemShelving; DROP TEMPORARY TABLE tItemShelving;

View File

@ -0,0 +1,14 @@
CREATE OR REPLACE TEMPORARY TABLE tItemShelvingLog
(PRIMARY KEY (id))
ENGINE = MEMORY
SELECT ishl.id, s.id shelvingFk
FROM shelving s
JOIN itemShelvingLog ishl ON ishl.shelvingFk = s.code COLLATE utf8mb3_unicode_ci;
ALTER TABLE vn.itemShelvingLog MODIFY COLUMN shelvingFk int(11) NOT NULL;
UPDATE itemShelvingLog ishl
JOIN tItemShelvingLog tishl ON tishl.id = ishl.id
SET ishl.shelvingFk = tishl.shelvingFk;
DROP TEMPORARY TABLE tItemShelvingLog;