add alembic migration for new columns

This commit is contained in:
maxDorninger
2025-07-16 01:19:26 +02:00
parent 4ca910ec98
commit d60f8bd89b
2 changed files with 38 additions and 1 deletions

View File

@@ -0,0 +1,37 @@
"""Add library field to Movie and Show tables
Revision ID: 1801d9f5a275
Revises: 333866afcd2c
Create Date: 2025-07-16 01:09:44.045395
"""
from typing import Sequence, Union
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision: str = "1801d9f5a275"
down_revision: Union[str, None] = "333866afcd2c"
branch_labels: Union[str, Sequence[str], None] = None
depends_on: Union[str, Sequence[str], None] = None
def upgrade() -> None:
"""Upgrade schema."""
op.add_column(
"movie",
sa.Column("library", sa.String(), nullable=False, server_default=sa.text("''")),
)
op.add_column(
"show",
sa.Column("library", sa.String(), nullable=False, server_default=sa.text("''")),
)
def downgrade() -> None:
"""Downgrade schema."""
op.drop_column("show", "library")
op.drop_column("movie", "library")

View File

@@ -12,7 +12,7 @@ api_base_path = "/api/v1"
development = false
[database]
host = "db"
host = "localhost"
port = 5432
user = "MediaManager"
password = "MediaManager"