1
试图弄清楚事务如何在phinx包中工作。这是我的迁移代码,它不起作用。我使用mysql
,一切正常phinx.yml
。因此表acme
被创建,而表fail
失败并且在phinxlog
表中没有找到记录。所以,当我跑phinx migrate
我错误SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'acme' already exists
。那么,我该如何使用交易?我没有找到任何文档,请帮助我))Phinx事务不起作用
public function up()
{
$this->getAdapter()->beginTransaction();
$this->table('acme')->addColumn('name', 'string')->create();
$this->table('fail')->addColumn('lal', 'failme')->create();
$this->getAdapter()->commitTransaction();
}
所有的表都有'InnoDB'引擎 –