8144-devToTest_2448 #3216

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

View File

@ -2,19 +2,5 @@ CREATE OR REPLACE TEMPORARY TABLE tmp.tItemShelving
(PRIMARY KEY (id))
ENGINE = MEMORY
SELECT ish.id, s.id shelvingFk
FROM vn.shelving s
JOIN vn.itemShelving ish ON ish.shelvingFk = s.code COLLATE utf8mb3_unicode_ci;
ALTER TABLE vn.itemShelving DROP FOREIGN KEY itemShelving_fk2,
MODIFY COLUMN shelvingFk int(11) NOT NULL;
UPDATE vn.itemShelving ish
JOIN tmp.tItemShelving tish ON tish.id = ish.id
SET ish.shelvingFk = tish.shelvingFk;
DROP TEMPORARY TABLE tmp.tItemShelving;
ALTER TABLE vn.itemShelving
ADD CONSTRAINT itemShelving_shelving_FK FOREIGN KEY (shelvingFk) REFERENCES vn.shelving(id)
ON DELETE RESTRICT
ON UPDATE CASCADE;
FROM vn.itemShelving ish
JOIN vn.shelving s ON s.code = ish.shelvingFk COLLATE utf8mb3_unicode_ci;

View File

@ -0,0 +1,2 @@
ALTER TABLE vn.itemShelving DROP FOREIGN KEY itemShelving_fk2,
MODIFY COLUMN shelvingFk int(11) NOT NULL;

View File

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

View File

@ -0,0 +1,3 @@
UPDATE vn.itemShelving ish
JOIN tmp.tItemShelving tish ON tish.id = ish.id
SET ish.shelvingFk = tish.shelvingFk;

View File

@ -0,0 +1,4 @@
ALTER TABLE vn.itemShelving
ADD CONSTRAINT itemShelving_shelving_FK FOREIGN KEY (shelvingFk) REFERENCES vn.shelving(id)
ON DELETE RESTRICT
ON UPDATE CASCADE;

View File

@ -0,0 +1,6 @@
CREATE OR REPLACE TEMPORARY TABLE tmp.tItemShelvingLog
(PRIMARY KEY (id))
ENGINE = MEMORY
SELECT ishl.id, s.id shelvingFk
FROM vn.itemShelvingLog ishl
JOIN vn.shelving s ON s.code = ishl.shelvingFk COLLATE utf8mb3_unicode_ci;

View File

@ -0,0 +1 @@
ALTER TABLE vn.itemShelvingLog MODIFY COLUMN shelvingFk int(11) NOT NULL;

View File

@ -0,0 +1,5 @@
UPDATE vn.itemShelvingLog ishl
JOIN tmp.tItemShelvingLog tishl ON tishl.id = ishl.id
SET ishl.shelvingFk = tishl.shelvingFk;
DROP TEMPORARY TABLE tmp.tItemShelvingLog;