Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions src/migrations/20200508112234_statuses_account_indexes.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
exports.up = async (knex) => {
return knex.schema.raw(`
CREATE INDEX CONCURRENTLY IF NOT EXISTS idx_tweets_id_account on statuses using BTREE (id DESC, account);
CREATE INDEX CONCURRENTLY IF NOT EXISTS idx_tweets_account_id on statuses using BTREE (account, id DESC);
DROP INDEX IF EXISTS idx_tweets_ids_lower_account;
DROP INDEX IF EXISTS idx_tweets_lower_account;
DROP INDEX IF EXISTS idx_tweets_lower_account_ids;
DROP INDEX IF EXISTS idx_tweets_account;
CREATE INDEX CONCURRENTLY IF NOT EXISTS idx_tweets_account on statuses using BTREE (account);
`);
};

exports.down = async () => {

};