Merge branch 'global-feed-index' into 'main'
Add a created_at, kind index for the global feed See merge request soapbox-pub/ditto!236
This commit is contained in:
commit
71899e54de
|
@ -4,7 +4,7 @@ export async function up(db: Kysely<any>): Promise<void> {
|
|||
await db.schema
|
||||
.createIndex('idx_events_kind_pubkey_created_at')
|
||||
.on('events')
|
||||
.columns(['kind', 'pubkey', 'created_at'])
|
||||
.columns(['kind', 'pubkey', 'created_at desc'])
|
||||
.execute();
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,14 @@
|
|||
import { Kysely } from 'kysely';
|
||||
|
||||
export async function up(db: Kysely<any>): Promise<void> {
|
||||
await db.schema
|
||||
.createIndex('idx_events_created_at_kind')
|
||||
.on('events')
|
||||
.columns(['created_at desc', 'kind'])
|
||||
.ifNotExists()
|
||||
.execute();
|
||||
}
|
||||
|
||||
export async function down(db: Kysely<any>): Promise<void> {
|
||||
await db.schema.dropIndex('idx_events_created_at_kind').ifExists().execute();
|
||||
}
|
Loading…
Reference in New Issue