add automatic alembic migrations to docker images

This commit is contained in:
maxDorninger
2025-06-01 22:45:16 +02:00
parent e9ff127c9f
commit 69d6fa7c15
6 changed files with 34 additions and 22 deletions

View File

@@ -10,14 +10,6 @@ from pydantic_settings import BaseSettings, SettingsConfigDict
from sqlalchemy import engine_from_config
from sqlalchemy import pool
from dotenv import load_dotenv
from pathlib import Path
env_path = Path(__file__).parent.parent.parent / Path("res") / Path(".env")
print(env_path)
load_dotenv(dotenv_path=env_path)
# this is the Alembic Config object, which provides
# access to the values within the .ini file in use.
config = context.config

View File

@@ -21,21 +21,12 @@ depends_on: Union[str, Sequence[str], None] = None
def upgrade() -> None:
"""Upgrade schema."""
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column("season", "size")
# ### end Alembic commands ###
def downgrade() -> None:
"""Downgrade schema."""
# ### commands auto generated by Alembic - please adjust! ###
op.add_column(
"season",
sa.Column(
"size",
sa.INTEGER(),
server_default=sa.text("0"),
autoincrement=False,
nullable=False,
),
)
# ### end Alembic commands ###