Add rollback after failed migration to allow subsequent migrations to run
When a migration fails, the transaction is left in a failed state. Without rollback, all subsequent migrations fail with "current transaction is aborted". This was preventing the team_id column from being added to projects.
This commit is contained in:
@@ -347,6 +347,7 @@ def _run_migrations():
|
|||||||
conn.execute(text(migration))
|
conn.execute(text(migration))
|
||||||
conn.commit()
|
conn.commit()
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
conn.rollback()
|
||||||
logger.warning(f"Migration failed (may already be applied): {e}")
|
logger.warning(f"Migration failed (may already be applied): {e}")
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user