From: Nicolas LÅ“uillet Date: Wed, 14 Dec 2016 08:47:07 +0000 (+0100) Subject: Added index on entry.uuid X-Git-Tag: 2.2.0~3^2~16^2~4 X-Git-Url: https://git.immae.eu/?a=commitdiff_plain;h=74b7c0985d3ff2b2011d0809c9b71e505e9aa947;p=github%2Fwallabag%2Fwallabag.git Added index on entry.uuid Useful for entry sharing --- diff --git a/app/DoctrineMigrations/Version20161214094403.php b/app/DoctrineMigrations/Version20161214094403.php new file mode 100644 index 00000000..fc9acb5a --- /dev/null +++ b/app/DoctrineMigrations/Version20161214094403.php @@ -0,0 +1,53 @@ +container = $container; + } + + private function getTable($tableName) + { + return $this->container->getParameter('database_table_prefix').$tableName; + } + + /** + * @param Schema $schema + */ + public function up(Schema $schema) + { + $entryTable = $schema->getTable($this->getTable('entry')); + $this->skipIf($entryTable->hasIndex($this->indexName), 'It seems that you already played this migration.'); + + $entryTable->addIndex(['uuid'], $this->indexName); + } + + /** + * @param Schema $schema + */ + public function down(Schema $schema) + { + $entryTable = $schema->getTable($this->getTable('entry')); + $this->skipIf(false === $entryTable->hasIndex($this->indexName), 'It seems that you already played this migration.'); + + $entryTable->dropIndex($this->indexName); + } +}