aboutsummaryrefslogtreecommitdiffhomepage
path: root/app/DoctrineMigrations/Version20161104073720.php
diff options
context:
space:
mode:
Diffstat (limited to 'app/DoctrineMigrations/Version20161104073720.php')
-rw-r--r--app/DoctrineMigrations/Version20161104073720.php14
1 files changed, 2 insertions, 12 deletions
diff --git a/app/DoctrineMigrations/Version20161104073720.php b/app/DoctrineMigrations/Version20161104073720.php
index 7a0361f8..cd2029cb 100644
--- a/app/DoctrineMigrations/Version20161104073720.php
+++ b/app/DoctrineMigrations/Version20161104073720.php
@@ -29,18 +29,8 @@ class Version20161104073720 extends AbstractMigration implements ContainerAwareI
29 */ 29 */
30 public function up(Schema $schema) 30 public function up(Schema $schema)
31 { 31 {
32 switch ($this->connection->getDatabasePlatform()->getName()) { 32 $entryTable = $schema->getTable($this->getTable('entry'));
33 case 'sqlite': 33 $entryTable->addIndex(['created_at']);
34 $this->addSql('CREATE INDEX `created_at` ON `'.$this->getTable('entry').'` (`created_at` DESC)');
35 break;
36
37 case 'mysql':
38 $this->addSql('ALTER TABLE '.$this->getTable('entry').' ADD INDEX created_at (created_at);');
39 break;
40
41 case 'postgresql':
42 $this->addSql('CREATE INDEX created_at ON '.$this->getTable('entry').' (created_at DESC)');
43 }
44 } 34 }
45 35
46 /** 36 /**