Some checks failed
CI/CD Pipeline / Code Quality Checks (push) Failing after 4m49s
CI/CD Pipeline / Security Scanning (push) Successful in 15s
CI/CD Pipeline / Tests (3.11) (push) Successful in 9m41s
CI/CD Pipeline / Tests (3.12) (push) Successful in 9m36s
CI/CD Pipeline / Build Docker Image (push) Has been skipped
Dependency Updates / Update Dependencies (push) Successful in 29s
38 lines
1.0 KiB
Python
38 lines
1.0 KiB
Python
"""Add metadata fields for managed banned words.
|
|
|
|
Revision ID: 20260117_add_banned_word_metadata
|
|
Revises: 20260117_enable_ai_defaults
|
|
Create Date: 2026-01-17 21:15:00.000000
|
|
"""
|
|
|
|
import sqlalchemy as sa
|
|
from alembic import op
|
|
|
|
# revision identifiers, used by Alembic.
|
|
revision = "20260117_add_banned_word_metadata"
|
|
down_revision = "20260117_enable_ai_defaults"
|
|
branch_labels = None
|
|
depends_on = None
|
|
|
|
|
|
def upgrade() -> None:
|
|
op.add_column(
|
|
"banned_words",
|
|
sa.Column("source", sa.String(length=100), nullable=True),
|
|
)
|
|
op.add_column(
|
|
"banned_words",
|
|
sa.Column("category", sa.String(length=20), nullable=True),
|
|
)
|
|
op.add_column(
|
|
"banned_words",
|
|
sa.Column("managed", sa.Boolean(), nullable=False, server_default=sa.text("false")),
|
|
)
|
|
op.alter_column("banned_words", "managed", server_default=None)
|
|
|
|
|
|
def downgrade() -> None:
|
|
op.drop_column("banned_words", "managed")
|
|
op.drop_column("banned_words", "category")
|
|
op.drop_column("banned_words", "source")
|