gpt4 book ai didi

php - Doctrine Migrations 中的回滚问题

转载 作者:行者123 更新时间:2023-12-02 01:10:59 25 4
gpt4 key购买 nike

我正在使用 Symfony 2.3.1,我想使用 DoctrineMigratios 部署我的数据库,但我在“up()”函数上遇到了一些麻烦。如果我尝试执行此示例:

$this->addSql("CREATE TABLE User (id INT AUTO_INCREMENT NOT NULL, name LONGTEXT DEFAULT NULL");
$this->addSql("CREATE TABLE User (id INT AUTO_INCREMENT NOT NULL, name LONGTEXT DEFAULT NULL");

我有一个错误(当然是同一张表)但是 DoctrineMigrations 没有执行回滚,最后我的数据库中有了“用户”表。不知道是不是我的配置或项目的问题,也可能是 DoctrineMigrations 的 bug。

有人可以帮助我吗?

最佳答案

我认为问题不在于教义。如果您使用 MySQL 作为 RDBMS,请阅读隐式提交 here :

The CREATE TABLE statement in InnoDB is processed as a single transaction. This means that a ROLLBACK from the user does not undo CREATE TABLE statements the user made during that transaction.

关于php - Doctrine Migrations 中的回滚问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17342368/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com