diff --git a/alembic/versions/0107_widen_notification_type_key.py b/alembic/versions/0107_widen_notification_type_key.py new file mode 100644 index 0000000..ba0f111 --- /dev/null +++ b/alembic/versions/0107_widen_notification_type_key.py @@ -0,0 +1,35 @@ +"""Widen notification_types.type_key from VARCHAR(20) to VARCHAR(100). + +The unified_search plugin declares 'search_reindex_complete' (22 chars) as a +notification type key, which exceeds the VARCHAR(20) limit and causes +StringDataRightTruncationError during plugin activation (sync_notification_types). +This breaks ALL plugin activations since sync runs for all active plugins. + +Revision ID: 0107 +""" + +from alembic import op +import sqlalchemy as sa + +revision = "0107" +down_revision = "0106" + + +def upgrade() -> None: + op.alter_column( + "notification_types", + "type_key", + existing_type=sa.String(20), + type=sa.String(100), + existing_nullable=False, + ) + + +def downgrade() -> None: + op.alter_column( + "notification_types", + "type_key", + existing_type=sa.String(100), + type=sa.String(20), + existing_nullable=False, + )