Initial commit - copied workspace after database cleanup

This commit is contained in:
RobbStarkAustria
2025-10-10 15:20:14 +00:00
commit 1efe40a03b
142 changed files with 23625 additions and 0 deletions

View File

@@ -0,0 +1,40 @@
"""Make conversions.file_hash NOT NULL
Revision ID: b5a6c3d4e7f8
Revises: 2b627d0885c3
Create Date: 2025-10-06 21:05:00.000000
"""
from typing import Sequence, Union
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision: str = "b5a6c3d4e7f8"
down_revision: Union[str, None] = "2b627d0885c3"
branch_labels: Union[str, Sequence[str], None] = None
depends_on: Union[str, Sequence[str], None] = None
def upgrade() -> None:
# Ensure no NULLs remain before altering nullability
op.execute("UPDATE conversions SET file_hash = '' WHERE file_hash IS NULL")
op.alter_column(
"conversions",
"file_hash",
existing_type=sa.String(length=64),
nullable=False,
existing_nullable=True,
)
def downgrade() -> None:
op.alter_column(
"conversions",
"file_hash",
existing_type=sa.String(length=64),
nullable=True,
existing_nullable=False,
)