2

Im using Symfony 2.3.1 and I want to deploy my database with DoctrineMigratios but I'm having some troubles on the "up()" function. If I try to execute this example:

$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");

I have an error (of course, is the same table) but DoctrineMigrations doesn't execute the rollback and finally I have the "User" table in my database. Don't know if is a problem of my configuration or project, or maybe is a bug of DoctrineMigrations.

Somebody could help me, please?

Omitsis
  • 23
  • 4

1 Answers1

6

I think problem is not in doctrine. If you are using MySQL as RDBMS please read about implicit commit 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.

Leonov Mike
  • 803
  • 6
  • 10