optimized migrations
This commit is contained in:
parent
3fcffcd1f3
commit
583b1f9d48
2 changed files with 6 additions and 14 deletions
|
@ -25,11 +25,9 @@ class Version20140505093853 extends AbstractMigration
|
||||||
public function up(Schema $schema)
|
public function up(Schema $schema)
|
||||||
{
|
{
|
||||||
// this up() migration is autogenerated, please modify it to your needs
|
// 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(
|
$this->addSql('CREATE TABLE digicomp_sequence_domain_model_insert (number INT NOT NULL, type VARCHAR(255) NOT NULL, PRIMARY KEY(number, type))');
|
||||||
"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)
|
public function down(Schema $schema)
|
||||||
{
|
{
|
||||||
// this down() migration is autogenerated, please modify it to your needs
|
// 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');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,10 +25,7 @@ class Version20160624203903 extends AbstractMigration
|
||||||
public function up(Schema $schema)
|
public function up(Schema $schema)
|
||||||
{
|
{
|
||||||
// this up() migration is autogenerated, please modify it to your needs
|
// this up() migration is autogenerated, please modify it to your needs
|
||||||
$this->abortIf(
|
$this->abortIf($this->connection->getDatabasePlatform()->getName() != 'mysql', 'Migration can only be executed safely on "mysql".');
|
||||||
$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)');
|
$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)
|
public function down(Schema $schema)
|
||||||
{
|
{
|
||||||
// this down() migration is autogenerated, please modify it to your needs
|
// this down() migration is autogenerated, please modify it to your needs
|
||||||
$this->abortIf(
|
$this->abortIf($this->connection->getDatabasePlatform()->getName() != 'mysql', 'Migration can only be executed safely on "mysql".');
|
||||||
$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');
|
$this->addSql('DROP INDEX type_idx ON digicomp_sequence_domain_model_insert');
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue