Phinx: Is there a way to not run all commands in a transaction

Created on 23 Nov 2015  路  1Comment  路  Source: cakephp/phinx

ALTER TYPE in PostgreSQL cannot be run inside a transaction so it would be nice if there was a switch to disable transactions for certain migrations.

Most helpful comment

@kidbrax at the moment theres not, however here is a workaround you could use:

$this->getAdapter()->commitTransaction();
// code to alter type
$this->getAdapter()->beginTransaction();

This ends the current open transaction, and then opens another one to keep Phinx happy.

>All comments

@kidbrax at the moment theres not, however here is a workaround you could use:

$this->getAdapter()->commitTransaction();
// code to alter type
$this->getAdapter()->beginTransaction();

This ends the current open transaction, and then opens another one to keep Phinx happy.

Was this page helpful?
0 / 5 - 0 ratings