From b98a6722f6700613aaca8c00ca5b86eb8735c324 Mon Sep 17 00:00:00 2001 From: Reham Muzzamil Date: Mon, 24 May 2021 14:07:22 +0500 Subject: [PATCH 1/2] 830 : Add metadata_version sequence and column in settings_metadata table --- ...dd_metadata_version_in_settings_metadata_table.sql | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100755 assets/migrations/scripts/20210520084102_add_metadata_version_in_settings_metadata_table.sql diff --git a/assets/migrations/scripts/20210520084102_add_metadata_version_in_settings_metadata_table.sql b/assets/migrations/scripts/20210520084102_add_metadata_version_in_settings_metadata_table.sql new file mode 100755 index 0000000..0d2aa4a --- /dev/null +++ b/assets/migrations/scripts/20210520084102_add_metadata_version_in_settings_metadata_table.sql @@ -0,0 +1,11 @@ +-- // add metadata_version in settings_metadata table +-- Migration SQL that makes the change goes here. + +CREATE SEQUENCE IF NOT EXISTS core.setting_metadata_version_seq START 1; +ALTER TABLE core.settings_metadata ADD COLUMN metadata_version bigint DEFAULT nextval('core.setting_metadata_version_seq'); + +-- //@UNDO +-- SQL to undo the change goes here. + +ALTER TABLE core.settings_metadata DROP COLUMN metadata_version; +DROP SEQUENCE IF EXISTS core.setting_metadata_version_seq; \ No newline at end of file From 48d90a81b4db19476a6c34c4e1bcd9e2cd3a3b39 Mon Sep 17 00:00:00 2001 From: rehammuzzamil <62061579+rehammuzzamil@users.noreply.github.com> Date: Wed, 26 May 2021 17:55:51 +0500 Subject: [PATCH 2/2] Update assets/migrations/scripts/20210520084102_add_metadata_version_in_settings_metadata_table.sql Co-authored-by: Benn Simon --- ...084102_add_metadata_version_in_settings_metadata_table.sql | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/assets/migrations/scripts/20210520084102_add_metadata_version_in_settings_metadata_table.sql b/assets/migrations/scripts/20210520084102_add_metadata_version_in_settings_metadata_table.sql index 0d2aa4a..c4b9920 100755 --- a/assets/migrations/scripts/20210520084102_add_metadata_version_in_settings_metadata_table.sql +++ b/assets/migrations/scripts/20210520084102_add_metadata_version_in_settings_metadata_table.sql @@ -2,10 +2,10 @@ -- Migration SQL that makes the change goes here. CREATE SEQUENCE IF NOT EXISTS core.setting_metadata_version_seq START 1; -ALTER TABLE core.settings_metadata ADD COLUMN metadata_version bigint DEFAULT nextval('core.setting_metadata_version_seq'); +ALTER TABLE core.settings_metadata ADD COLUMN IF NOT EXISTS metadata_version bigint DEFAULT nextval('core.setting_metadata_version_seq'); -- //@UNDO -- SQL to undo the change goes here. ALTER TABLE core.settings_metadata DROP COLUMN metadata_version; -DROP SEQUENCE IF EXISTS core.setting_metadata_version_seq; \ No newline at end of file +DROP SEQUENCE IF EXISTS core.setting_metadata_version_seq;