This commit is contained in:
2026-03-18 17:06:48 +01:00
parent 2b40c64c7c
commit 3098c850bd
2 changed files with 6 additions and 2 deletions

View File

@@ -86,7 +86,7 @@ path_separator = os
# database URL. This is consumed by the user-maintained env.py script only. # database URL. This is consumed by the user-maintained env.py script only.
# other means of configuring database URLs may be customized within the env.py # other means of configuring database URLs may be customized within the env.py
# file. # file.
sqlalchemy.url = postgresql://wikitcg:password@localhost/wikitcg sqlalchemy.url = placeholder
[post_write_hooks] [post_write_hooks]

View File

@@ -6,6 +6,10 @@ from sqlalchemy import pool
from alembic import context from alembic import context
from models import Base from models import Base
import os
from dotenv import load_dotenv
load_dotenv()
# this is the Alembic Config object, which provides # this is the Alembic Config object, which provides
# access to the values within the .ini file in use. # access to the values within the .ini file in use.
config = context.config config = context.config
@@ -39,7 +43,7 @@ def run_migrations_offline() -> None:
script output. script output.
""" """
url = config.get_main_option("sqlalchemy.url") url = config.get_main_option("sqlalchemy.url", os.environ["DATABASE_URL"])
context.configure( context.configure(
url=url, url=url,
target_metadata=target_metadata, target_metadata=target_metadata,