diff options
Diffstat (limited to 'app')
-rw-r--r-- | app/DoctrineMigrations/Version20190806130304.php | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/app/DoctrineMigrations/Version20190806130304.php b/app/DoctrineMigrations/Version20190806130304.php index 1449bdd3..4d6b7897 100644 --- a/app/DoctrineMigrations/Version20190806130304.php +++ b/app/DoctrineMigrations/Version20190806130304.php | |||
@@ -32,16 +32,19 @@ final class Version20190806130304 extends WallabagMigration | |||
32 | $this->addSql('CREATE INDEX IDX_F4D18282A76ED395 ON ' . $this->getTable('entry', true) . ' (user_id)'); | 32 | $this->addSql('CREATE INDEX IDX_F4D18282A76ED395 ON ' . $this->getTable('entry', true) . ' (user_id)'); |
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_starred ON ' . $this->getTable('entry', true) . ' (user_id, is_starred, starred_at)'); | 36 | $this->addSql('CREATE INDEX user_starred ON ' . $this->getTable('entry', true) . ' (user_id, is_starred, starred_at)'); |
36 | break; | 37 | break; |
37 | case 'mysql': | 38 | case 'mysql': |
38 | $this->addSql('ALTER TABLE ' . $this->getTable('entry') . ' MODIFY language VARCHAR(20) DEFAULT NULL'); | 39 | $this->addSql('ALTER TABLE ' . $this->getTable('entry') . ' MODIFY language VARCHAR(20) DEFAULT NULL'); |
39 | $this->addSql('CREATE INDEX user_language ON ' . $this->getTable('entry') . ' (language, user_id)'); | 40 | $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)'); | ||
40 | $this->addSql('CREATE INDEX user_starred ON ' . $this->getTable('entry') . ' (user_id, is_starred, starred_at)'); | 42 | $this->addSql('CREATE INDEX user_starred ON ' . $this->getTable('entry') . ' (user_id, is_starred, starred_at)'); |
41 | break; | 43 | break; |
42 | case 'postgresql': | 44 | case 'postgresql': |
43 | $this->addSql('ALTER TABLE ' . $this->getTable('entry') . ' ALTER language TYPE VARCHAR(20)'); | 45 | $this->addSql('ALTER TABLE ' . $this->getTable('entry') . ' ALTER language TYPE VARCHAR(20)'); |
44 | $this->addSql('CREATE INDEX user_language ON ' . $this->getTable('entry') . ' (language, user_id)'); | 46 | $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)'); | ||
45 | $this->addSql('CREATE INDEX user_starred ON ' . $this->getTable('entry') . ' (user_id, is_starred, starred_at)'); | 48 | $this->addSql('CREATE INDEX user_starred ON ' . $this->getTable('entry') . ' (user_id, is_starred, starred_at)'); |
46 | break; | 49 | break; |
47 | } | 50 | } |
@@ -57,6 +60,7 @@ final class Version20190806130304 extends WallabagMigration | |||
57 | $this->addSql('DROP INDEX hashed_url_user_id'); | 60 | $this->addSql('DROP INDEX hashed_url_user_id'); |
58 | $this->addSql('DROP INDEX hashed_given_url_user_id'); | 61 | $this->addSql('DROP INDEX hashed_given_url_user_id'); |
59 | $this->addSql('DROP INDEX user_language'); | 62 | $this->addSql('DROP INDEX user_language'); |
63 | $this->addSql('DROP INDEX user_archived'); | ||
60 | $this->addSql('DROP INDEX user_starred'); | 64 | $this->addSql('DROP INDEX user_starred'); |
61 | $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)); | 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)); |
62 | $this->addSql('DROP TABLE ' . $this->getTable('entry', true)); | 66 | $this->addSql('DROP TABLE ' . $this->getTable('entry', true)); |
@@ -74,11 +78,13 @@ final class Version20190806130304 extends WallabagMigration | |||
74 | case 'mysql': | 78 | case 'mysql': |
75 | $this->addSql('ALTER TABLE ' . $this->getTable('entry') . ' MODIFY language LONGTEXT DEFAULT NULL'); | 79 | $this->addSql('ALTER TABLE ' . $this->getTable('entry') . ' MODIFY language LONGTEXT DEFAULT NULL'); |
76 | $this->addSql('DROP INDEX user_language ON ' . $this->getTable('entry')); | 80 | $this->addSql('DROP INDEX user_language ON ' . $this->getTable('entry')); |
81 | $this->addSql('DROP INDEX user_archived ON ' . $this->getTable('entry')); | ||
77 | $this->addSql('DROP INDEX user_starred ON ' . $this->getTable('entry')); | 82 | $this->addSql('DROP INDEX user_starred ON ' . $this->getTable('entry')); |
78 | break; | 83 | break; |
79 | case 'postgresql': | 84 | case 'postgresql': |
80 | $this->addSql('ALTER TABLE ' . $this->getTable('entry') . ' ALTER language TYPE TEXT'); | 85 | $this->addSql('ALTER TABLE ' . $this->getTable('entry') . ' ALTER language TYPE TEXT'); |
81 | $this->addSql('DROP INDEX user_language ON ' . $this->getTable('entry')); | 86 | $this->addSql('DROP INDEX user_language ON ' . $this->getTable('entry')); |
87 | $this->addSql('DROP INDEX user_archived ON ' . $this->getTable('entry')); | ||
82 | $this->addSql('DROP INDEX user_starred ON ' . $this->getTable('entry')); | 88 | $this->addSql('DROP INDEX user_starred ON ' . $this->getTable('entry')); |
83 | break; | 89 | break; |
84 | } | 90 | } |