fix: drop notifications_legacy view before ALTER COLUMN type in migration 0135

This commit is contained in:
Agent Zero
2026-08-21 10:04:13 +02:00
parent a614ab337b
commit 283409513e
@@ -16,6 +16,8 @@ depends_on = None
def upgrade() -> None:
# 1. Fix VARCHAR length mismatches (model defines longer than DB)
# Drop notifications_legacy view first — it depends on notifications.type column
op.execute("DROP VIEW IF EXISTS notifications_legacy CASCADE;")
op.execute("ALTER TABLE contacts ALTER COLUMN status TYPE VARCHAR(30);")
op.execute("ALTER TABLE notifications ALTER COLUMN type TYPE VARCHAR(100);")
op.execute("ALTER TABLE notification_preferences ALTER COLUMN type_key TYPE VARCHAR(100);")