diff --git a/alembic/versions/0134_notification_types_columns.py b/alembic/versions/0134_notification_types_columns.py new file mode 100644 index 0000000..9947e25 --- /dev/null +++ b/alembic/versions/0134_notification_types_columns.py @@ -0,0 +1,26 @@ +"""Fix notification_types column sizes — VARCHAR(20) too small for values. + +Revision ID: 0134 +Revises: 0133 +Create Date: 2026-08-21 +""" +from alembic import op + +revision = "0134" +down_revision = "0133" +branch_labels = None +depends_on = None + + +def upgrade() -> None: + op.execute("ALTER TABLE notification_types ALTER COLUMN type_key TYPE VARCHAR(100);") + op.execute("ALTER TABLE notification_types ALTER COLUMN plugin_name TYPE VARCHAR(100);") + op.execute("ALTER TABLE notification_types ALTER COLUMN category TYPE VARCHAR(50);") + op.execute("ALTER TABLE notification_types ALTER COLUMN label TYPE VARCHAR(200);") + + +def downgrade() -> None: + op.execute("ALTER TABLE notification_types ALTER COLUMN label TYPE VARCHAR(200);") + op.execute("ALTER TABLE notification_types ALTER COLUMN category TYPE VARCHAR(20);") + op.execute("ALTER TABLE notification_types ALTER COLUMN plugin_name TYPE VARCHAR(20);") + op.execute("ALTER TABLE notification_types ALTER COLUMN type_key TYPE VARCHAR(20);")