本文介绍了在事务中运行Alembic升级迁移的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

alembic升级头是否在事务内运行,以便所有数据库更改成功或失败?如果不是,为什么要这样设计呢?

Does alembic upgrade head run inside a transaction so that all database alterations succeed, or fail? If not, why was it designed this way?

推荐答案

我的理解是alembic运行在支持它的数据库的事务中,例如Postgres。如果您使用的数据库不支持此功能(咳嗽 MySQL 咳嗽),则不能使用此功能。

My understanding is alembic runs inside a transaction for databases that support it, like Postgres. If you're on a database that does not support this (cough MySQL cough), you can't use this functionality.

这篇关于在事务中运行Alembic升级迁移的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-15 23:43