Added dropColumn for SQLite and some enhancements

This commit is contained in:
Nicolas Lœuillet
2016-11-26 15:40:42 +01:00
parent a4d55a9161
commit 84c6a48df4
6 changed files with 37 additions and 35 deletions

View File

@ -29,18 +29,8 @@ class Version20161104073720 extends AbstractMigration implements ContainerAwareI
*/
public function up(Schema $schema)
{
switch ($this->connection->getDatabasePlatform()->getName()) {
case 'sqlite':
$this->addSql('CREATE INDEX `created_at` ON `'.$this->getTable('entry').'` (`created_at` DESC)');
break;
case 'mysql':
$this->addSql('ALTER TABLE '.$this->getTable('entry').' ADD INDEX created_at (created_at);');
break;
case 'postgresql':
$this->addSql('CREATE INDEX created_at ON '.$this->getTable('entry').' (created_at DESC)');
}
$entryTable = $schema->getTable($this->getTable('entry'));
$entryTable->addIndex(['created_at']);
}
/**