Skip to content

Commit

Permalink
Add root entries index (#179)
Browse files Browse the repository at this point in the history
  • Loading branch information
imsitnikov authored Sep 6, 2024
1 parent fb311c9 commit 18c0dd2
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/db/migrations/20240906131505_add_root_entries_index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import {Knex} from 'knex';

export async function up(knex: Knex): Promise<void> {
return knex.raw(`
CREATE INDEX CONCURRENTLY entries_root_tenant_id_idx
ON entries(tenant_id)
WHERE
key NOT LIKE '_%/_%';
`);
}

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

export const config = {
transaction: false,
};

0 comments on commit 18c0dd2

Please sign in to comment.