aboutsummaryrefslogtreecommitdiffhomepage
path: root/app/DoctrineMigrations/Version20190806130304.php
diff options
context:
space:
mode:
Diffstat (limited to 'app/DoctrineMigrations/Version20190806130304.php')
-rw-r--r--app/DoctrineMigrations/Version20190806130304.php6
1 files changed, 6 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 }