Skip to content

Commit c9c8db6

Browse files
authored
Revert "Fix sql table migration mm"
1 parent 08905f1 commit c9c8db6

1 file changed

Lines changed: 0 additions & 58 deletions

File tree

‎src/server/upgrade/index.md‎

Lines changed: 0 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -20,65 +20,7 @@ Make sure to always back up your database data before doing a migration.
2020

2121
Perform the migration:
2222

23-
0. Fix table - migration from old to new MM version
24-
25-
```bash
26-
$ docker ps -a | grep postgres
27-
```
28-
2b261cd55de2 postgres:14 "docker-entrypoint.s…" 4 weeks ago Up About a minute 5432/tcp merginmaps-db
29-
30-
```bash
31-
$ docker exec -it 2b261cd55de2 bash
32-
```
33-
```bash
34-
psql -U postgres
35-
```
36-
37-
```bash
38-
select * from project;
39-
```
40-
```bash
41-
BEGIN;
42-
43-
CREATE SEQUENCE IF NOT EXISTS public.map_overview_id_seq;
44-
45-
CREATE TABLE IF NOT EXISTS public.map_overview
46-
(
47-
id INTEGER NOT NULL DEFAULT nextval('map_overview_id_seq'::regclass),
48-
project_id UUID NOT NULL,
49-
version CHARACTER VARYING,
50-
config JSON,
51-
data_location CHARACTER VARYING,
52-
qgis_file CHARACTER VARYING,
53-
54-
CONSTRAINT pk_map_overview
55-
PRIMARY KEY (id, project_id),
56-
57-
CONSTRAINT fk_map_overview_project_id_project
58-
FOREIGN KEY (project_id)
59-
REFERENCES public.project (id)
60-
ON DELETE CASCADE
61-
);
62-
63-
CREATE INDEX IF NOT EXISTS ix_map_overview_project_id
64-
ON public.map_overview (project_id ASC NULLS LAST);
65-
66-
CREATE INDEX IF NOT EXISTS ix_map_overview_version
67-
ON public.map_overview (version ASC NULLS LAST);
68-
69-
COMMIT;
70-
```
71-
72-
```bash
73-
select * from map_overview;
74-
```
75-
id | project_id | version | config | data_location | qgis_file
76-
----+------------+---------+--------+---------------+-----------
77-
(0 rows)
78-
79-
8023
1. Stop your running docker containers
81-
8224
```bash
8325
$ docker compose -f docker-compose.yml down # or similarly, based on your previous deployment
8426
```

0 commit comments

Comments
 (0)