fix: drop notifications_legacy view before ALTER COLUMN type in migration 0135
This commit is contained in:
@@ -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);")
|
||||
|
||||
Reference in New Issue
Block a user