diff --git a/docker-compose.yml b/docker-compose.yml index c1f7e7b8b2..ad6ab8dfb0 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -61,6 +61,7 @@ services: - fmtm_images:/opt/app/images - fmtm_tiles:/opt/tiles - ./src/backend/app:/opt/app + - ./src/backend/migrations:/opt/migrations # - ../osm-fieldwork/osm_fieldwork:/home/appuser/.local/lib/python3.10/site-packages/osm_fieldwork depends_on: - fmtm-db diff --git a/src/backend/migrations/versions/ec28a415c8d8_create_inital_tables.py b/src/backend/migrations/versions/ec28a415c8d8_create_inital_tables.py index 8aa8382f5a..b6ceffed2e 100644 --- a/src/backend/migrations/versions/ec28a415c8d8_create_inital_tables.py +++ b/src/backend/migrations/versions/ec28a415c8d8_create_inital_tables.py @@ -5,7 +5,7 @@ Create Date: 2023-09-26 09:04:00.676103 """ -import imp + import os import geoalchemy2 @@ -13,11 +13,6 @@ from alembic import op from sqlalchemy.dialects import postgresql -alembic_helpers = imp.load_source( - "alembic_helpers", - (os.getcwd() + "/" + op.get_context().script.dir + "/alembic_helpers.py"), -) - # revision identifiers, used by Alembic. revision = "ec28a415c8d8" down_revision = None @@ -26,6 +21,13 @@ def upgrade() -> None: + + import imp + alembic_helpers = imp.load_source( + "alembic_helpers", + (os.getcwd() + "/" + op.get_context().script.dir + "/alembic_helpers.py"), + ) + # ### commands auto generated by Alembic - please adjust! ### if alembic_helpers.table_does_not_exist("loader_platform"): op.create_table(