From cffc1964b64adcf8575aa5a567fec4477fbe8e75 Mon Sep 17 00:00:00 2001 From: guillermo Date: Wed, 17 Apr 2024 10:26:21 +0200 Subject: [PATCH] feat: refs #6968 Transactioned and isTriggerDisabled --- .../10997-crimsonCyca/00-groupingMode.sql | 16 ++++++++++++++++ db/versions/10997-crimsonCyca/00-part1.sql | 2 -- db/versions/10997-crimsonCyca/01-part2.sql | 7 ------- db/versions/10997-crimsonCyca/02-part3.sql | 2 -- 4 files changed, 16 insertions(+), 11 deletions(-) create mode 100644 db/versions/10997-crimsonCyca/00-groupingMode.sql delete mode 100644 db/versions/10997-crimsonCyca/00-part1.sql delete mode 100644 db/versions/10997-crimsonCyca/01-part2.sql delete mode 100644 db/versions/10997-crimsonCyca/02-part3.sql diff --git a/db/versions/10997-crimsonCyca/00-groupingMode.sql b/db/versions/10997-crimsonCyca/00-groupingMode.sql new file mode 100644 index 000000000..dd4896cc1 --- /dev/null +++ b/db/versions/10997-crimsonCyca/00-groupingMode.sql @@ -0,0 +1,16 @@ +START TRANSACTION; + +SET @isTriggerDisabled = TRUE; + +ALTER TABLE vn.buy ADD groupingMode2 enum('grouping', 'packing') DEFAULT NULL NULL; +ALTER TABLE vn.buy CHANGE groupingMode2 groupingMode2 enum('grouping', 'packing') DEFAULT NULL NULL AFTER groupingMode; + +UPDATE vn.buy SET groupingMode2 = 'packing' WHERE groupingMode = 2; +UPDATE vn.buy SET groupingMode2 = 'grouping' WHERE groupingMode = 1; + +ALTER TABLE vn.buy DROP COLUMN groupingMode; +ALTER TABLE vn.buy CHANGE groupingMode2 groupingMode enum('grouping','packing') CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL NULL; + +SET @isTriggerDisabled = FALSE; + +COMMIT; \ No newline at end of file diff --git a/db/versions/10997-crimsonCyca/00-part1.sql b/db/versions/10997-crimsonCyca/00-part1.sql deleted file mode 100644 index 8811b81a7..000000000 --- a/db/versions/10997-crimsonCyca/00-part1.sql +++ /dev/null @@ -1,2 +0,0 @@ -ALTER TABLE vn.buy ADD groupingMode2 enum('grouping', 'packing') DEFAULT NULL NULL; -ALTER TABLE vn.buy CHANGE groupingMode2 groupingMode2 enum('grouping', 'packing') DEFAULT NULL NULL AFTER groupingMode; diff --git a/db/versions/10997-crimsonCyca/01-part2.sql b/db/versions/10997-crimsonCyca/01-part2.sql deleted file mode 100644 index 1f7a3c9f6..000000000 --- a/db/versions/10997-crimsonCyca/01-part2.sql +++ /dev/null @@ -1,7 +0,0 @@ -UPDATE vn.buy - SET groupingMode2 = 'packing' - WHERE groupingMode = 2; - -UPDATE vn.buy - SET groupingMode2 = 'grouping' - WHERE groupingMode = 1; diff --git a/db/versions/10997-crimsonCyca/02-part3.sql b/db/versions/10997-crimsonCyca/02-part3.sql deleted file mode 100644 index c63560957..000000000 --- a/db/versions/10997-crimsonCyca/02-part3.sql +++ /dev/null @@ -1,2 +0,0 @@ -ALTER TABLE vn.buy DROP COLUMN groupingMode; -ALTER TABLE vn.buy CHANGE groupingMode2 groupingMode enum('grouping','packing') CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL NULL;