Skip to content

Commit

Permalink
Added index for fk to states, locks (#48)
Browse files Browse the repository at this point in the history
  • Loading branch information
jhoncool authored Dec 22, 2023
1 parent 087f57e commit cb350b0
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/db/migrations/20231222084058_add_locks_states_fk_indexes.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import type {Knex} from 'knex';

export async function up(knex: Knex): Promise<void> {
return knex.raw(`
CREATE INDEX states_entry_id_idx ON states(entry_id);
CREATE INDEX locks_entry_id_idx ON locks(entry_id);
`);
}

export async function down(knex: Knex): Promise<void> {
return knex.raw(`
DROP INDEX locks_entry_id_idx;
DROP INDEX states_entry_id_idx;
`);
}

0 comments on commit cb350b0

Please sign in to comment.