From 6a335cada418cef00c16b98f803a4e28ed8a5d0c Mon Sep 17 00:00:00 2001 From: GeryNi Date: Tue, 13 Aug 2024 11:30:44 +0200 Subject: [PATCH] added migration scripts in repository. --- .../4.2.5/{migrate-default.sql => migrate-4.2.5.sql} | 3 +++ .../4.4.2/{migrate-default.sql => migrate-4.4.2.sql} | 5 ----- .../setup/sql-metawal/migrate/4.4.3/migrate-4.4.3.sql | 6 ++++++ 3 files changed, 9 insertions(+), 5 deletions(-) rename web/src/main/webapp/WEB-INF/classes/setup/sql-metawal/migrate/4.2.5/{migrate-default.sql => migrate-4.2.5.sql} (84%) rename web/src/main/webapp/WEB-INF/classes/setup/sql-metawal/migrate/4.4.2/{migrate-default.sql => migrate-4.4.2.sql} (89%) create mode 100644 web/src/main/webapp/WEB-INF/classes/setup/sql-metawal/migrate/4.4.3/migrate-4.4.3.sql diff --git a/web/src/main/webapp/WEB-INF/classes/setup/sql-metawal/migrate/4.2.5/migrate-default.sql b/web/src/main/webapp/WEB-INF/classes/setup/sql-metawal/migrate/4.2.5/migrate-4.2.5.sql similarity index 84% rename from web/src/main/webapp/WEB-INF/classes/setup/sql-metawal/migrate/4.2.5/migrate-default.sql rename to web/src/main/webapp/WEB-INF/classes/setup/sql-metawal/migrate/4.2.5/migrate-4.2.5.sql index 1d3125012c6..2317959243a 100644 --- a/web/src/main/webapp/WEB-INF/classes/setup/sql-metawal/migrate/4.2.5/migrate-default.sql +++ b/web/src/main/webapp/WEB-INF/classes/setup/sql-metawal/migrate/4.2.5/migrate-4.2.5.sql @@ -16,5 +16,8 @@ ALTER TABLE spg_page ALTER COLUMN link TYPE text; ALTER TABLE Languages DROP COLUMN isdefault; +ALTER TABLE files ALTER COLUMN content TYPE oid USING content::oid; +ALTER TABLE spg_page ALTER COLUMN link TYPE text USING link::text; + UPDATE Settings SET value='4.2.5' WHERE name='system/platform/version'; UPDATE Settings SET value='SNAPSHOT' WHERE name='system/platform/subVersion'; diff --git a/web/src/main/webapp/WEB-INF/classes/setup/sql-metawal/migrate/4.4.2/migrate-default.sql b/web/src/main/webapp/WEB-INF/classes/setup/sql-metawal/migrate/4.4.2/migrate-4.4.2.sql similarity index 89% rename from web/src/main/webapp/WEB-INF/classes/setup/sql-metawal/migrate/4.4.2/migrate-default.sql rename to web/src/main/webapp/WEB-INF/classes/setup/sql-metawal/migrate/4.4.2/migrate-4.4.2.sql index 0ffbf9674a2..7751b8bf0fa 100644 --- a/web/src/main/webapp/WEB-INF/classes/setup/sql-metawal/migrate/4.4.2/migrate-default.sql +++ b/web/src/main/webapp/WEB-INF/classes/setup/sql-metawal/migrate/4.4.2/migrate-4.4.2.sql @@ -9,16 +9,11 @@ INSERT INTO Settings (name, value, datatype, position, internal) SELECT distinct INSERT INTO Settings (name, value, datatype, position, internal) SELECT distinct 'metadata/batchediting/accesslevel', 'Editor', 0, 12020, 'n' from settings WHERE NOT EXISTS (SELECT name FROM Settings WHERE name = 'metadata/batchediting/accesslevel'); -ALTER TABLE files - ALTER COLUMN content type oid USING content::oid; - ALTER TABLE settings ALTER COLUMN editable TYPE CHAR USING editable::char; ALTER TABLE settings ALTER COLUMN editable SET DEFAULT 'y'; -ALTER TABLE spg_page ALTER COLUMN link TYPE text; - UPDATE Settings SET value='4.4.2' WHERE name='system/platform/version'; UPDATE Settings SET value='SNAPSHOT' WHERE name='system/platform/subVersion'; diff --git a/web/src/main/webapp/WEB-INF/classes/setup/sql-metawal/migrate/4.4.3/migrate-4.4.3.sql b/web/src/main/webapp/WEB-INF/classes/setup/sql-metawal/migrate/4.4.3/migrate-4.4.3.sql new file mode 100644 index 00000000000..7f345b22609 --- /dev/null +++ b/web/src/main/webapp/WEB-INF/classes/setup/sql-metawal/migrate/4.4.3/migrate-4.4.3.sql @@ -0,0 +1,6 @@ +UPDATE Settings SET value='4.4.3' WHERE name='system/platform/version'; +UPDATE Settings SET value='0' WHERE name='system/platform/subVersion'; + + +INSERT INTO Settings (name, value, datatype, position, internal) VALUES ('system/documentation/url', 'https://docs.geonetwork-opensource.org/{{version}}/{{lang}}', 0, 570, 'n'); +INSERT INTO Settings (name, value, datatype, position, internal) VALUES ('system/userFeedback/metadata/enable', 'false', 2, 1913, 'n'); \ No newline at end of file