diff --git a/src/db/migrations/20231222084058_add_locks_states_fk_indexes.ts b/src/db/migrations/20231222084058_add_locks_states_fk_indexes.ts new file mode 100644 index 00000000..f971a74e --- /dev/null +++ b/src/db/migrations/20231222084058_add_locks_states_fk_indexes.ts @@ -0,0 +1,17 @@ +import type {Knex} from 'knex'; + +export async function up(knex: Knex): Promise { + 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 { + return knex.raw(` + DROP INDEX locks_entry_id_idx; + + DROP INDEX states_entry_id_idx; + `); +}