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);")