Add a created_at, kind index for the global feed
This commit is contained in:
parent
c6c10e4b7f
commit
b16d5b749e
|
@ -4,7 +4,7 @@ export async function up(db: Kysely<any>): Promise<void> {
|
||||||
await db.schema
|
await db.schema
|
||||||
.createIndex('idx_events_kind_pubkey_created_at')
|
.createIndex('idx_events_kind_pubkey_created_at')
|
||||||
.on('events')
|
.on('events')
|
||||||
.columns(['kind', 'pubkey', 'created_at'])
|
.columns(['kind', 'pubkey', 'created_at desc'])
|
||||||
.execute();
|
.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