Files
spoolman2/migrations/versions/2024_01_03_1346-ccbb17aeda7c_added_settings_table.py
Donkie 535fa40ad2 Updated most python dependencies
Primarily FastAPI and Pydantic to v2. Also ruff to latest.

Updated some code to support Pydantic v2
2024-05-23 19:42:27 +02:00

34 lines
862 B
Python

"""Added Settings table.
Revision ID: ccbb17aeda7c
Revises: b82cd9e2aa6f
Create Date: 2024-01-03 13:46:41.362341
"""
import sqlalchemy as sa
from alembic import op
# revision identifiers, used by Alembic.
revision = "ccbb17aeda7c"
down_revision = "b82cd9e2aa6f"
branch_labels = None
depends_on = None
def upgrade() -> None:
"""Perform the upgrade."""
op.create_table(
"setting",
sa.Column("key", sa.String(length=64), nullable=False),
sa.Column("value", sa.Text(), nullable=False),
sa.Column("last_updated", sa.DateTime(), nullable=False),
sa.PrimaryKeyConstraint("key"),
)
op.create_index(op.f("ix_setting_key"), "setting", ["key"], unique=False)
def downgrade() -> None:
"""Perform the downgrade."""
op.drop_index(op.f("ix_setting_key"), table_name="setting")
op.drop_table("setting")