aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorOlivier Mehani <shtrom@ssji.net>2019-08-07 22:02:37 +1000
committerOlivier Mehani <shtrom@ssji.net>2019-08-07 22:02:37 +1000
commit2b0f4e86b27fec39f5e172fbeba9ce033aef2e79 (patch)
tree57fb70add4d29e54920a5df9dacce823b5e3ae05
parent588de419e043bc1d8876552809607721cb256094 (diff)
downloadwallabag-2b0f4e86b27fec39f5e172fbeba9ce033aef2e79.tar.gz
wallabag-2b0f4e86b27fec39f5e172fbeba9ce033aef2e79.tar.zst
wallabag-2b0f4e86b27fec39f5e172fbeba9ce033aef2e79.zip
Add user_created index
Signed-off-by: Olivier Mehani <shtrom@ssji.net>
-rw-r--r--app/DoctrineMigrations/Version20190806130304.php6
-rw-r--r--src/Wallabag/CoreBundle/Entity/Entry.php1
2 files changed, 7 insertions, 0 deletions
diff --git a/app/DoctrineMigrations/Version20190806130304.php b/app/DoctrineMigrations/Version20190806130304.php
index 4d6b7897..ca94c080 100644
--- a/app/DoctrineMigrations/Version20190806130304.php
+++ b/app/DoctrineMigrations/Version20190806130304.php
@@ -33,18 +33,21 @@ final class Version20190806130304 extends WallabagMigration
33 $this->addSql('CREATE INDEX hashed_given_url_user_id ON ' . $this->getTable('entry', true) . ' (user_id, hashed_given_url)'); 33 $this->addSql('CREATE INDEX hashed_given_url_user_id ON ' . $this->getTable('entry', true) . ' (user_id, hashed_given_url)');
34 $this->addSql('CREATE INDEX user_language ON ' . $this->getTable('entry', true) . ' (language, user_id)'); 34 $this->addSql('CREATE INDEX user_language ON ' . $this->getTable('entry', true) . ' (language, user_id)');
35 $this->addSql('CREATE INDEX user_archived ON ' . $this->getTable('entry', true) . ' (user_id, is_archived, archived_at)'); 35 $this->addSql('CREATE INDEX user_archived ON ' . $this->getTable('entry', true) . ' (user_id, is_archived, archived_at)');
36 $this->addSql('CREATE INDEX user_created ON ' . $this->getTable('entry', true) . ' (user_id, created_at)');
36 $this->addSql('CREATE INDEX user_starred ON ' . $this->getTable('entry', true) . ' (user_id, is_starred, starred_at)'); 37 $this->addSql('CREATE INDEX user_starred ON ' . $this->getTable('entry', true) . ' (user_id, is_starred, starred_at)');
37 break; 38 break;
38 case 'mysql': 39 case 'mysql':
39 $this->addSql('ALTER TABLE ' . $this->getTable('entry') . ' MODIFY language VARCHAR(20) DEFAULT NULL'); 40 $this->addSql('ALTER TABLE ' . $this->getTable('entry') . ' MODIFY language VARCHAR(20) DEFAULT NULL');
40 $this->addSql('CREATE INDEX user_language ON ' . $this->getTable('entry') . ' (language, user_id)'); 41 $this->addSql('CREATE INDEX user_language ON ' . $this->getTable('entry') . ' (language, user_id)');
41 $this->addSql('CREATE INDEX user_archived ON ' . $this->getTable('entry') . ' (user_id, is_archived, archived_at)'); 42 $this->addSql('CREATE INDEX user_archived ON ' . $this->getTable('entry') . ' (user_id, is_archived, archived_at)');
43 $this->addSql('CREATE INDEX user_created ON ' . $this->getTable('entry') . ' (user_id, created_at)');
42 $this->addSql('CREATE INDEX user_starred ON ' . $this->getTable('entry') . ' (user_id, is_starred, starred_at)'); 44 $this->addSql('CREATE INDEX user_starred ON ' . $this->getTable('entry') . ' (user_id, is_starred, starred_at)');
43 break; 45 break;
44 case 'postgresql': 46 case 'postgresql':
45 $this->addSql('ALTER TABLE ' . $this->getTable('entry') . ' ALTER language TYPE VARCHAR(20)'); 47 $this->addSql('ALTER TABLE ' . $this->getTable('entry') . ' ALTER language TYPE VARCHAR(20)');
46 $this->addSql('CREATE INDEX user_language ON ' . $this->getTable('entry') . ' (language, user_id)'); 48 $this->addSql('CREATE INDEX user_language ON ' . $this->getTable('entry') . ' (language, user_id)');
47 $this->addSql('CREATE INDEX user_archived ON ' . $this->getTable('entry') . ' (user_id, is_archived, archived_at)'); 49 $this->addSql('CREATE INDEX user_archived ON ' . $this->getTable('entry') . ' (user_id, is_archived, archived_at)');
50 $this->addSql('CREATE INDEX user_created ON ' . $this->getTable('entry') . ' (user_id, created_at)');
48 $this->addSql('CREATE INDEX user_starred ON ' . $this->getTable('entry') . ' (user_id, is_starred, starred_at)'); 51 $this->addSql('CREATE INDEX user_starred ON ' . $this->getTable('entry') . ' (user_id, is_starred, starred_at)');
49 break; 52 break;
50 } 53 }
@@ -61,6 +64,7 @@ final class Version20190806130304 extends WallabagMigration
61 $this->addSql('DROP INDEX hashed_given_url_user_id'); 64 $this->addSql('DROP INDEX hashed_given_url_user_id');
62 $this->addSql('DROP INDEX user_language'); 65 $this->addSql('DROP INDEX user_language');
63 $this->addSql('DROP INDEX user_archived'); 66 $this->addSql('DROP INDEX user_archived');
67 $this->addSql('DROP INDEX user_created');
64 $this->addSql('DROP INDEX user_starred'); 68 $this->addSql('DROP INDEX user_starred');
65 $this->addSql('CREATE TEMPORARY TABLE __temp__wallabag_entry AS SELECT id, user_id, uid, title, url, hashed_url, origin_url, given_url, hashed_given_url, is_archived, archived_at, is_starred, content, created_at, updated_at, published_at, published_by, starred_at, mimetype, language, reading_time, domain_name, preview_picture, http_status, headers FROM ' . $this->getTable('entry', true)); 69 $this->addSql('CREATE TEMPORARY TABLE __temp__wallabag_entry AS SELECT id, user_id, uid, title, url, hashed_url, origin_url, given_url, hashed_given_url, is_archived, archived_at, is_starred, content, created_at, updated_at, published_at, published_by, starred_at, mimetype, language, reading_time, domain_name, preview_picture, http_status, headers FROM ' . $this->getTable('entry', true));
66 $this->addSql('DROP TABLE ' . $this->getTable('entry', true)); 70 $this->addSql('DROP TABLE ' . $this->getTable('entry', true));
@@ -79,12 +83,14 @@ final class Version20190806130304 extends WallabagMigration
79 $this->addSql('ALTER TABLE ' . $this->getTable('entry') . ' MODIFY language LONGTEXT DEFAULT NULL'); 83 $this->addSql('ALTER TABLE ' . $this->getTable('entry') . ' MODIFY language LONGTEXT DEFAULT NULL');
80 $this->addSql('DROP INDEX user_language ON ' . $this->getTable('entry')); 84 $this->addSql('DROP INDEX user_language ON ' . $this->getTable('entry'));
81 $this->addSql('DROP INDEX user_archived ON ' . $this->getTable('entry')); 85 $this->addSql('DROP INDEX user_archived ON ' . $this->getTable('entry'));
86 $this->addSql('DROP INDEX user_created ON ' . $this->getTable('entry'));
82 $this->addSql('DROP INDEX user_starred ON ' . $this->getTable('entry')); 87 $this->addSql('DROP INDEX user_starred ON ' . $this->getTable('entry'));
83 break; 88 break;
84 case 'postgresql': 89 case 'postgresql':
85 $this->addSql('ALTER TABLE ' . $this->getTable('entry') . ' ALTER language TYPE TEXT'); 90 $this->addSql('ALTER TABLE ' . $this->getTable('entry') . ' ALTER language TYPE TEXT');
86 $this->addSql('DROP INDEX user_language ON ' . $this->getTable('entry')); 91 $this->addSql('DROP INDEX user_language ON ' . $this->getTable('entry'));
87 $this->addSql('DROP INDEX user_archived ON ' . $this->getTable('entry')); 92 $this->addSql('DROP INDEX user_archived ON ' . $this->getTable('entry'));
93 $this->addSql('DROP INDEX user_created ON ' . $this->getTable('entry'));
88 $this->addSql('DROP INDEX user_starred ON ' . $this->getTable('entry')); 94 $this->addSql('DROP INDEX user_starred ON ' . $this->getTable('entry'));
89 break; 95 break;
90 } 96 }
diff --git a/src/Wallabag/CoreBundle/Entity/Entry.php b/src/Wallabag/CoreBundle/Entity/Entry.php
index 49f19cfa..4acec261 100644
--- a/src/Wallabag/CoreBundle/Entity/Entry.php
+++ b/src/Wallabag/CoreBundle/Entity/Entry.php
@@ -31,6 +31,7 @@ use Wallabag\UserBundle\Entity\User;
31 * @ORM\Index(name="hashed_given_url_user_id", columns={"user_id", "hashed_given_url"}, options={"lengths"={null, 40}}), 31 * @ORM\Index(name="hashed_given_url_user_id", columns={"user_id", "hashed_given_url"}, options={"lengths"={null, 40}}),
32 * @ORM\Index(name="user_language", columns={"language", "user_id"}), 32 * @ORM\Index(name="user_language", columns={"language", "user_id"}),
33 * @ORM\Index(name="user_archived", columns={"user_id", "is_archived", "archived_at"}), 33 * @ORM\Index(name="user_archived", columns={"user_id", "is_archived", "archived_at"}),
34 * @ORM\Index(name="user_created", columns={"user_id", "created_at"}),
34 * @ORM\Index(name="user_starred", columns={"user_id", "is_starred", "starred_at"}) 35 * @ORM\Index(name="user_starred", columns={"user_id", "is_starred", "starred_at"})
35 * } 36 * }
36 * ) 37 * )