fix: Widen notification_types.type_key from VARCHAR(20) to VARCHAR(100) (migration 0107)
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
This commit is contained in:
@@ -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,
|
||||
)
|
||||
Reference in New Issue
Block a user