Add missing index on kind-pubkey-created_at

This commit is contained in:
Alex Gleason 2024-03-02 17:57:43 -06:00
parent ad59c24f77
commit dffa70e2fe
No known key found for this signature in database
GPG Key ID: 7211D1F99744FBB7
1 changed files with 16 additions and 0 deletions

View File

@ -0,0 +1,16 @@
import { Kysely } from '@/deps.ts';
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'])
.execute();
}
export async function down(db: Kysely<any>): Promise<void> {
await db.schema
.dropIndex('idx_events_kind_pubkey_created_at')
.on('events')
.execute();
}