Running php app/console doctrine:migrations:diff generates a new migration class necessary to translate the current database schema to the value indicated by the changes for the objects.
This example shows the generated class to create the fos_user table:
class Version20120712145445 extends AbstractMigration { public function up(Schema $schema) { $this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql"); $this->addSql("CREATE TABLE fos_user (id INT AUTO_INCREMENT NOT NULL, ...); } public function down(Schema $schema) { $this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql"); $this->addSql("DROP TABLE fos_user"); } }
As you can see, this generated migration is bound to a specific database server, which is MySQL in this case.
I would like to use the in-memory sqlite database in test environments because of the (expected) performance benefits that shorten the test execution time.
I could take the above SQL code and translate it into the equivalents of $table = $schema->createTable(); $table->addColumn(); $table = $schema->createTable(); $table->addColumn(); , however, it takes so long and requires errors due to poor translation of the SQL language into code.
Can the: migrations: diff command doctrine generate platform agnostic migration code instead of the platform specific SQL platform above?
source share