-
Notifications
You must be signed in to change notification settings - Fork 21
Clarify migration steps for overviews table issue #787
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| -- ============================================================ | ||
| -- PATCH: Create map_overview table | ||
| -- ============================================================ | ||
|
|
||
| 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; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -20,23 +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 the issue of missing overviews table in case it was not created during older db migration. | ||
|
|
||
| ```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 | ||
| $ docker exec -it merginmaps-db bash | ||
| ``` | ||
| Run commands in postgres container: | ||
|
|
||
| ```bash | ||
| psql -U postgres | ||
| ``` | ||
|
|
||
| ```bash | ||
| select * from project; | ||
| ``` | ||
| ```bash | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We could probably just add link to public repository sql.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes I can only upload the link to download the SQL file
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we discussed that and for convenience I would keep it in docs, that's the source where admins are copy pasting commands |
||
| BEGIN; | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this could go to the step where migrations are running - no step 0. You need to double check if map_overviews table is there and if not just run sql.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be a good idea to fix this before running the migration so that there is no error message about the missing table.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this table fix belongs to 2025.7.3 migration as that is the one which relies on that missing table (and potentially also newer ones).