mirror of
https://github.com/aljazceru/ditto.git
synced 2025-12-25 17:24:25 +01:00
Add missing index on kind-pubkey-created_at
This commit is contained in:
16
src/db/migrations/011_kind_author_index.ts
Normal file
16
src/db/migrations/011_kind_author_index.ts
Normal 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();
|
||||
}
|
||||
Reference in New Issue
Block a user