mirror of
https://github.com/wallabag/wallabag.git
synced 2024-11-22 17:11:07 +00:00
Add user_archived index
Signed-off-by: Olivier Mehani <shtrom@ssji.net>
This commit is contained in:
parent
b700b38e17
commit
588de419e0
2 changed files with 7 additions and 0 deletions
|
@ -32,16 +32,19 @@ final class Version20190806130304 extends WallabagMigration
|
|||
$this->addSql('CREATE INDEX IDX_F4D18282A76ED395 ON ' . $this->getTable('entry', true) . ' (user_id)');
|
||||
$this->addSql('CREATE INDEX hashed_given_url_user_id ON ' . $this->getTable('entry', true) . ' (user_id, hashed_given_url)');
|
||||
$this->addSql('CREATE INDEX user_language ON ' . $this->getTable('entry', true) . ' (language, user_id)');
|
||||
$this->addSql('CREATE INDEX user_archived ON ' . $this->getTable('entry', true) . ' (user_id, is_archived, archived_at)');
|
||||
$this->addSql('CREATE INDEX user_starred ON ' . $this->getTable('entry', true) . ' (user_id, is_starred, starred_at)');
|
||||
break;
|
||||
case 'mysql':
|
||||
$this->addSql('ALTER TABLE ' . $this->getTable('entry') . ' MODIFY language VARCHAR(20) DEFAULT NULL');
|
||||
$this->addSql('CREATE INDEX user_language ON ' . $this->getTable('entry') . ' (language, user_id)');
|
||||
$this->addSql('CREATE INDEX user_archived ON ' . $this->getTable('entry') . ' (user_id, is_archived, archived_at)');
|
||||
$this->addSql('CREATE INDEX user_starred ON ' . $this->getTable('entry') . ' (user_id, is_starred, starred_at)');
|
||||
break;
|
||||
case 'postgresql':
|
||||
$this->addSql('ALTER TABLE ' . $this->getTable('entry') . ' ALTER language TYPE VARCHAR(20)');
|
||||
$this->addSql('CREATE INDEX user_language ON ' . $this->getTable('entry') . ' (language, user_id)');
|
||||
$this->addSql('CREATE INDEX user_archived ON ' . $this->getTable('entry') . ' (user_id, is_archived, archived_at)');
|
||||
$this->addSql('CREATE INDEX user_starred ON ' . $this->getTable('entry') . ' (user_id, is_starred, starred_at)');
|
||||
break;
|
||||
}
|
||||
|
@ -57,6 +60,7 @@ final class Version20190806130304 extends WallabagMigration
|
|||
$this->addSql('DROP INDEX hashed_url_user_id');
|
||||
$this->addSql('DROP INDEX hashed_given_url_user_id');
|
||||
$this->addSql('DROP INDEX user_language');
|
||||
$this->addSql('DROP INDEX user_archived');
|
||||
$this->addSql('DROP INDEX user_starred');
|
||||
$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));
|
||||
$this->addSql('DROP TABLE ' . $this->getTable('entry', true));
|
||||
|
@ -74,11 +78,13 @@ final class Version20190806130304 extends WallabagMigration
|
|||
case 'mysql':
|
||||
$this->addSql('ALTER TABLE ' . $this->getTable('entry') . ' MODIFY language LONGTEXT DEFAULT NULL');
|
||||
$this->addSql('DROP INDEX user_language ON ' . $this->getTable('entry'));
|
||||
$this->addSql('DROP INDEX user_archived ON ' . $this->getTable('entry'));
|
||||
$this->addSql('DROP INDEX user_starred ON ' . $this->getTable('entry'));
|
||||
break;
|
||||
case 'postgresql':
|
||||
$this->addSql('ALTER TABLE ' . $this->getTable('entry') . ' ALTER language TYPE TEXT');
|
||||
$this->addSql('DROP INDEX user_language ON ' . $this->getTable('entry'));
|
||||
$this->addSql('DROP INDEX user_archived ON ' . $this->getTable('entry'));
|
||||
$this->addSql('DROP INDEX user_starred ON ' . $this->getTable('entry'));
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -30,6 +30,7 @@ use Wallabag\UserBundle\Entity\User;
|
|||
* @ORM\Index(name="hashed_url_user_id", columns={"user_id", "hashed_url"}, options={"lengths"={null, 40}}),
|
||||
* @ORM\Index(name="hashed_given_url_user_id", columns={"user_id", "hashed_given_url"}, options={"lengths"={null, 40}}),
|
||||
* @ORM\Index(name="user_language", columns={"language", "user_id"}),
|
||||
* @ORM\Index(name="user_archived", columns={"user_id", "is_archived", "archived_at"}),
|
||||
* @ORM\Index(name="user_starred", columns={"user_id", "is_starred", "starred_at"})
|
||||
* }
|
||||
* )
|
||||
|
|
Loading…
Reference in a new issue