From 4b72530566142a0f2d8aa25ac7681bccf7550cf4 Mon Sep 17 00:00:00 2001 From: Agent Zero Date: Tue, 4 Aug 2026 23:24:39 +0200 Subject: [PATCH] fix: Widen notification_types.type_key from VARCHAR(20) to VARCHAR(100) (migration 0107) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plugin activation was broken for ALL inactive plugins because sync_notification_types() tried to INSERT search_reindex_complete (22 chars) into type_key VARCHAR(20), causing StringDataRightTruncationError. Alembic head: 0106 → 0107 --- .../0107_widen_notification_type_key.py | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 alembic/versions/0107_widen_notification_type_key.py 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, + )