optimized migrations

This commit is contained in:
Robin Krahnen 2020-03-11 17:24:48 +01:00
parent 3fcffcd1f3
commit 583b1f9d48
2 changed files with 6 additions and 14 deletions

View file

@ -25,11 +25,9 @@ class Version20140505093853 extends AbstractMigration
public function up(Schema $schema)
{
// this up() migration is autogenerated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql");
$this->abortIf($this->connection->getDatabasePlatform()->getName() != 'mysql', 'Migration can only be executed safely on "mysql".');
$this->addSql(
"CREATE TABLE digicomp_sequence_domain_model_insert (number INT NOT NULL, type VARCHAR(255) NOT NULL, PRIMARY KEY(number, type))"
);
$this->addSql('CREATE TABLE digicomp_sequence_domain_model_insert (number INT NOT NULL, type VARCHAR(255) NOT NULL, PRIMARY KEY(number, type))');
}
/**
@ -39,8 +37,8 @@ class Version20140505093853 extends AbstractMigration
public function down(Schema $schema)
{
// this down() migration is autogenerated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql");
$this->abortIf($this->connection->getDatabasePlatform()->getName() != 'mysql', 'Migration can only be executed safely on "mysql".');
$this->addSql("DROP TABLE digicomp_sequence_domain_model_insert");
$this->addSql('DROP TABLE digicomp_sequence_domain_model_insert');
}
}

View file

@ -25,10 +25,7 @@ class Version20160624203903 extends AbstractMigration
public function up(Schema $schema)
{
// this up() migration is autogenerated, please modify it to your needs
$this->abortIf(
$this->connection->getDatabasePlatform()->getName() != 'mysql',
'Migration can only be executed safely on "mysql".'
);
$this->abortIf($this->connection->getDatabasePlatform()->getName() != 'mysql', 'Migration can only be executed safely on "mysql".');
$this->addSql('CREATE INDEX type_idx ON digicomp_sequence_domain_model_insert (type)');
}
@ -40,10 +37,7 @@ class Version20160624203903 extends AbstractMigration
public function down(Schema $schema)
{
// this down() migration is autogenerated, please modify it to your needs
$this->abortIf(
$this->connection->getDatabasePlatform()->getName() != 'mysql',
'Migration can only be executed safely on "mysql".'
);
$this->abortIf($this->connection->getDatabasePlatform()->getName() != 'mysql', 'Migration can only be executed safely on "mysql".');
$this->addSql('DROP INDEX type_idx ON digicomp_sequence_domain_model_insert');
}