From 5eda0af20f84f609fe9d992ca45d788c605822fe Mon Sep 17 00:00:00 2001 From: Pako Date: Wed, 9 Oct 2024 07:24:34 +0200 Subject: [PATCH] feat: refs #8075 itemShelvingMoving --- db/routines/vn/triggers/itemShelving_beforeUpdate.sql | 3 +++ db/versions/11294-azureFern/00-firstScript.sql | 3 +++ 2 files changed, 6 insertions(+) create mode 100644 db/versions/11294-azureFern/00-firstScript.sql diff --git a/db/routines/vn/triggers/itemShelving_beforeUpdate.sql b/db/routines/vn/triggers/itemShelving_beforeUpdate.sql index fabdf8efb..53f85de01 100644 --- a/db/routines/vn/triggers/itemShelving_beforeUpdate.sql +++ b/db/routines/vn/triggers/itemShelving_beforeUpdate.sql @@ -9,5 +9,8 @@ BEGIN SET NEW.userFk = account.myUser_getId(); END IF; + IF NEW.shelvingFk <> OLD.shelvingFk THEN + SET NEW.movingState = NULL; + END IF; END$$ DELIMITER ; diff --git a/db/versions/11294-azureFern/00-firstScript.sql b/db/versions/11294-azureFern/00-firstScript.sql new file mode 100644 index 000000000..2d6ed3a5b --- /dev/null +++ b/db/versions/11294-azureFern/00-firstScript.sql @@ -0,0 +1,3 @@ +-- Place your SQL code here +ALTER TABLE vn.itemShelving DROP COLUMN IF EXISTS isMoving; +ALTER TABLE vn.itemShelving ADD IF NOT EXISTS movingState ENUM('selected','printed') NULL; \ No newline at end of file