mirror of
https://gitlab.com/soapbox-pub/ditto.git
synced 2025-12-06 11:29:46 +00:00
perf(event_zaps): make two separate indexes instead of a compound index
This commit is contained in:
parent
3a8ade4de2
commit
05bf417bcc
1 changed files with 9 additions and 2 deletions
|
|
@ -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();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue