From e91f204ef5b715312f8e99d11b0b262a8a091cc1 Mon Sep 17 00:00:00 2001 From: JaroslavMasar74 <84442077+JaroslavMasar74@users.noreply.github.com> Date: Mon, 20 Jul 2026 13:19:06 +0200 Subject: [PATCH 1/5] Document migration steps for new MM version Added migration instructions for updating the database schema before migration start , including sequence and table creation. --- src/server/upgrade/index.md | 59 +++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) diff --git a/src/server/upgrade/index.md b/src/server/upgrade/index.md index 865d295c..cbf25bb0 100644 --- a/src/server/upgrade/index.md +++ b/src/server/upgrade/index.md @@ -19,6 +19,65 @@ Make sure to always back up your database data before doing a migration. Perform the migration: +0. Fix table - migration from old to new MM versieon + ```bash + $ docker ps -a | grep postgres + 2b261cd55de2 postgres:14 "docker-entrypoint.s…" 4 weeks ago Up About a minute 5432/tcp merginmaps-db + + ```bash + $ docker exec -it 2b261cd55de2 bash + + ```bash + # psql -U postgres + + ```bash + # select * from project; + + ```bash + # BEGIN; + + CREATE SEQUENCE IF NOT EXISTS public.map_overview_id_seq; + + CREATE TABLE IF NOT EXISTS public.map_overview + ( + id INTEGER NOT NULL DEFAULT nextval('map_overview_id_seq'::regclass), + project_id UUID NOT NULL, + version CHARACTER VARYING, + config JSON, + data_location CHARACTER VARYING, + qgis_file CHARACTER VARYING, + + CONSTRAINT pk_map_overview + PRIMARY KEY (id, project_id), + + CONSTRAINT fk_map_overview_project_id_project + FOREIGN KEY (project_id) + REFERENCES public.project (id) + ON DELETE CASCADE + ); + + CREATE INDEX IF NOT EXISTS ix_map_overview_project_id + ON public.map_overview (project_id ASC NULLS LAST); + + CREATE INDEX IF NOT EXISTS ix_map_overview_version + ON public.map_overview (version ASC NULLS LAST); + + COMMIT; + + + ```bash + # select * from map_overview; + + id | project_id | version | config | data_location | qgis_file + ----+------------+---------+--------+---------------+----------- + (0 rows) + + + + + + + 1. Stop your running docker containers ```bash From 2354f0b406483818ba2759d4e4447221d0db6e2c Mon Sep 17 00:00:00 2001 From: JaroslavMasar74 <84442077+JaroslavMasar74@users.noreply.github.com> Date: Mon, 20 Jul 2026 13:19:47 +0200 Subject: [PATCH 2/5] Update migration instructions in index.md Added instructions for fixing the table during migration. --- src/server/upgrade/index.md | 1 + 1 file changed, 1 insertion(+) diff --git a/src/server/upgrade/index.md b/src/server/upgrade/index.md index cbf25bb0..a013d479 100644 --- a/src/server/upgrade/index.md +++ b/src/server/upgrade/index.md @@ -19,6 +19,7 @@ Make sure to always back up your database data before doing a migration. Perform the migration: + 0. Fix table - migration from old to new MM versieon ```bash $ docker ps -a | grep postgres From 6493f0811ed22eaa7942fed66f8abbc3d28422bf Mon Sep 17 00:00:00 2001 From: JaroslavMasar74 <84442077+JaroslavMasar74@users.noreply.github.com> Date: Mon, 20 Jul 2026 13:41:49 +0200 Subject: [PATCH 3/5] Fix typo in migration instructions --- src/server/upgrade/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/upgrade/index.md b/src/server/upgrade/index.md index a013d479..7c752f0f 100644 --- a/src/server/upgrade/index.md +++ b/src/server/upgrade/index.md @@ -20,7 +20,7 @@ Make sure to always back up your database data before doing a migration. Perform the migration: -0. Fix table - migration from old to new MM versieon +0. Fix table - migration from old to new MM version ```bash $ docker ps -a | grep postgres 2b261cd55de2 postgres:14 "docker-entrypoint.s…" 4 weeks ago Up About a minute 5432/tcp merginmaps-db From a17d1679b80320c5a70fb0b5a45a9e8d7a3de98d Mon Sep 17 00:00:00 2001 From: JaroslavMasar74 <84442077+JaroslavMasar74@users.noreply.github.com> Date: Mon, 20 Jul 2026 13:49:25 +0200 Subject: [PATCH 4/5] Update index.md --- src/server/upgrade/index.md | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/src/server/upgrade/index.md b/src/server/upgrade/index.md index 7c752f0f..f30f3c94 100644 --- a/src/server/upgrade/index.md +++ b/src/server/upgrade/index.md @@ -20,20 +20,23 @@ Make sure to always back up your database data before doing a migration. Perform the migration: -0. Fix table - migration from old to new MM version +0. Fix table - migration from old to new MM version +1. ```bash $ docker ps -a | grep postgres + ``` 2b261cd55de2 postgres:14 "docker-entrypoint.s…" 4 weeks ago Up About a minute 5432/tcp merginmaps-db ```bash $ docker exec -it 2b261cd55de2 bash - + ``` ```bash # psql -U postgres + ``` ```bash # select * from project; - + ``` ```bash # BEGIN; @@ -64,23 +67,18 @@ Perform the migration: ON public.map_overview (version ASC NULLS LAST); COMMIT; - + ``` ```bash # select * from map_overview; - + ``` id | project_id | version | config | data_location | qgis_file ----+------------+---------+--------+---------------+----------- (0 rows) - - - - - - 1. Stop your running docker containers + ```bash $ docker compose -f docker-compose.yml down # or similarly, based on your previous deployment ``` From 278d33662ee2019a125993551c27d5b1b78cb74b Mon Sep 17 00:00:00 2001 From: JaroslavMasar74 <84442077+JaroslavMasar74@users.noreply.github.com> Date: Mon, 20 Jul 2026 13:51:54 +0200 Subject: [PATCH 5/5] Refine PostgreSQL migration command formatting Updated migration instructions for PostgreSQL commands to remove unnecessary '#' characters. --- src/server/upgrade/index.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/server/upgrade/index.md b/src/server/upgrade/index.md index f30f3c94..edef582b 100644 --- a/src/server/upgrade/index.md +++ b/src/server/upgrade/index.md @@ -21,7 +21,7 @@ Make sure to always back up your database data before doing a migration. Perform the migration: 0. Fix table - migration from old to new MM version -1. + ```bash $ docker ps -a | grep postgres ``` @@ -31,14 +31,14 @@ Perform the migration: $ docker exec -it 2b261cd55de2 bash ``` ```bash - # psql -U postgres + psql -U postgres ``` ```bash - # select * from project; + select * from project; ``` ```bash - # BEGIN; + BEGIN; CREATE SEQUENCE IF NOT EXISTS public.map_overview_id_seq; @@ -70,7 +70,7 @@ Perform the migration: ``` ```bash - # select * from map_overview; + select * from map_overview; ``` id | project_id | version | config | data_location | qgis_file ----+------------+---------+--------+---------------+-----------