Skip to content

Commit

Permalink
sqlalchemy url obtained from settings for alembic migrations
Browse files Browse the repository at this point in the history
  • Loading branch information
nrjadkry committed Sep 26, 2023
1 parent ddfca4e commit 3a97024
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/backend/app/alembic.ini
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,7 @@ version_path_separator = os # Use os.pathsep. Default configuration used for ne
# are written from script.py.mako
# output_encoding = utf-8

sqlalchemy.url = postgresql+psycopg2://fmtm:fmtm@fmtm-db:5432/testingfmtm

sqlalchemy.url =

[post_write_hooks]
# post_write_hooks defines scripts or Python functions that are run
Expand Down Expand Up @@ -112,3 +111,5 @@ formatter = generic
[formatter_generic]
format = %(levelname)-5.5s [%(name)s] %(message)s
datefmt = %H:%M:%S


3 changes: 3 additions & 0 deletions src/backend/app/migrations/env.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,13 @@

from sqlalchemy import engine_from_config
from sqlalchemy import pool
from config import settings
from geoalchemy2 import alembic_helpers

from alembic import context

config = context.config
config.set_main_option("sqlalchemy.url", settings.SQLALCHEMY_URL)

if config.config_file_name is not None:
fileConfig(config.config_file_name)
Expand Down

0 comments on commit 3a97024

Please sign in to comment.