From 74b7c0985d3ff2b2011d0809c9b71e505e9aa947 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Wed, 14 Dec 2016 09:47:07 +0100 Subject: Added index on entry.uuid Useful for entry sharing --- app/DoctrineMigrations/Version20161214094403.php | 53 ++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 app/DoctrineMigrations/Version20161214094403.php (limited to 'app/DoctrineMigrations/Version20161214094403.php') 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); + } +} -- cgit v1.2.3 From 7239082a5e290dada1d393f7a25acebb09ace2de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Thu, 29 Dec 2016 10:09:44 +0100 Subject: Renamed uuid to uid --- app/DoctrineMigrations/Version20161214094403.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'app/DoctrineMigrations/Version20161214094403.php') diff --git a/app/DoctrineMigrations/Version20161214094403.php b/app/DoctrineMigrations/Version20161214094403.php index fc9acb5a..5948b5fa 100644 --- a/app/DoctrineMigrations/Version20161214094403.php +++ b/app/DoctrineMigrations/Version20161214094403.php @@ -8,7 +8,7 @@ use Symfony\Component\DependencyInjection\ContainerAwareInterface; use Symfony\Component\DependencyInjection\ContainerInterface; /** - * Added index on wallabag_entry.uuid + * Added index on wallabag_entry.uid */ class Version20161214094403 extends AbstractMigration implements ContainerAwareInterface { @@ -17,7 +17,7 @@ class Version20161214094403 extends AbstractMigration implements ContainerAwareI */ private $container; - private $indexName = 'IDX_entry_uiid'; + private $indexName = 'IDX_entry_uid'; public function setContainer(ContainerInterface $container = null) { @@ -37,7 +37,7 @@ class Version20161214094403 extends AbstractMigration implements ContainerAwareI $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); + $entryTable->addIndex(['uid'], $this->indexName); } /** -- cgit v1.2.3