From 283409513e77f8fd517c3a3c1f2726389bf75025 Mon Sep 17 00:00:00 2001 From: Agent Zero Date: Fri, 21 Aug 2026 10:04:13 +0200 Subject: [PATCH] fix: drop notifications_legacy view before ALTER COLUMN type in migration 0135 --- alembic/versions/0135_fix_schema_drifts.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/alembic/versions/0135_fix_schema_drifts.py b/alembic/versions/0135_fix_schema_drifts.py index a9ddd88..ae44a80 100644 --- a/alembic/versions/0135_fix_schema_drifts.py +++ b/alembic/versions/0135_fix_schema_drifts.py @@ -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);")