mirror of
https://github.com/aljazceru/ditto.git
synced 2026-01-12 10:04:20 +01:00
perf(event_zaps): make two separate indexes instead of a compound index
This commit is contained in:
@@ -11,15 +11,22 @@ export async function up(db: Kysely<any>): Promise<void> {
|
||||
.execute();
|
||||
|
||||
await db.schema
|
||||
.createIndex('idx_event_zaps_id_amount')
|
||||
.createIndex('idx_event_zaps_amount_millisats')
|
||||
.on('event_zaps')
|
||||
.column('amount_millisats')
|
||||
.ifNotExists()
|
||||
.execute();
|
||||
|
||||
await db.schema
|
||||
.createIndex('idx_event_zaps_target_event_id')
|
||||
.on('event_zaps')
|
||||
.column('target_event_id')
|
||||
.ifNotExists()
|
||||
.execute();
|
||||
}
|
||||
|
||||
export async function down(db: Kysely<any>): Promise<void> {
|
||||
await db.schema.dropIndex('idx_event_zaps_id_amount').ifExists().execute();
|
||||
await db.schema.dropIndex('idx_event_zaps_amount_millisats').ifExists().execute();
|
||||
await db.schema.dropIndex('idx_event_zaps_target_event_id').ifExists().execute();
|
||||
await db.schema.dropTable('event_zaps').execute();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user