Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 58 additions & 0 deletions src/server/upgrade/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,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 version
Comment thread
JaroslavMasar74 marked this conversation as resolved.

```bash
$ docker ps -a | grep postgres
Comment thread
JaroslavMasar74 marked this conversation as resolved.
```
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;
Comment thread
JaroslavMasar74 marked this conversation as resolved.
```
```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
$ docker compose -f docker-compose.yml down # or similarly, based on your previous deployment
```
Expand Down
Loading