8144-devToTest_2448 #3216
|
@ -2,13 +2,13 @@ CREATE OR REPLACE TEMPORARY TABLE tItemShelving
|
||||||
(PRIMARY KEY (id))
|
(PRIMARY KEY (id))
|
||||||
ENGINE = MEMORY
|
ENGINE = MEMORY
|
||||||
SELECT ish.id, s.id shelvingFk
|
SELECT ish.id, s.id shelvingFk
|
||||||
FROM shelving s
|
FROM vn.shelving s
|
||||||
JOIN itemShelving ish ON ish.shelvingFk = s.code COLLATE utf8mb3_unicode_ci;
|
JOIN vn.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 vn.itemShelving ish
|
||||||
JOIN tItemShelving tish ON tish.id = ish.id
|
JOIN tItemShelving tish ON tish.id = ish.id
|
||||||
SET ish.shelvingFk = tish.shelvingFk;
|
SET ish.shelvingFk = tish.shelvingFk;
|
||||||
|
|
||||||
|
|
|
@ -2,12 +2,12 @@ CREATE OR REPLACE TEMPORARY TABLE tItemShelvingLog
|
||||||
(PRIMARY KEY (id))
|
(PRIMARY KEY (id))
|
||||||
ENGINE = MEMORY
|
ENGINE = MEMORY
|
||||||
SELECT ishl.id, s.id shelvingFk
|
SELECT ishl.id, s.id shelvingFk
|
||||||
FROM shelving s
|
FROM vn.shelving s
|
||||||
JOIN itemShelvingLog ishl ON ishl.shelvingFk = s.code COLLATE utf8mb3_unicode_ci;
|
JOIN vn.itemShelvingLog ishl ON ishl.shelvingFk = s.code COLLATE utf8mb3_unicode_ci;
|
||||||
|
|
||||||
ALTER TABLE vn.itemShelvingLog MODIFY COLUMN shelvingFk int(11) NOT NULL;
|
ALTER TABLE vn.itemShelvingLog MODIFY COLUMN shelvingFk int(11) NOT NULL;
|
||||||
|
|
||||||
UPDATE itemShelvingLog ishl
|
UPDATE vn.itemShelvingLog ishl
|
||||||
JOIN tItemShelvingLog tishl ON tishl.id = ishl.id
|
JOIN tItemShelvingLog tishl ON tishl.id = ishl.id
|
||||||
SET ishl.shelvingFk = tishl.shelvingFk;
|
SET ishl.shelvingFk = tishl.shelvingFk;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue