mirror of
https://github.com/maxdorninger/MediaManager.git
synced 2026-04-17 15:13:24 +02:00
add automatic alembic migrations to docker images
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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 ###
|
||||
|
||||
Reference in New Issue
Block a user