Skip to content

Commit

Permalink
fix: added pg versioning entity index (#580)
Browse files Browse the repository at this point in the history
  • Loading branch information
alxc authored Mar 18, 2024
1 parent f7194ca commit fab1946
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions registry/server/migrations/20240315141721_pg_versioning_idx.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { Knex } from 'knex';
import { isPostgres } from '../util/db';

export async function up(knex: Knex): Promise<void> {
if (isPostgres(knex)) {
return knex.raw('CREATE INDEX versioning_entity_idx ON public."versioning" (entity_type,entity_id,id DESC);');
}
}

export async function down(knex: Knex): Promise<void> {
if (isPostgres(knex)) {
return knex.raw('DROP INDEX versioning_entity_idx;');
}
}

0 comments on commit fab1946

Please sign in to comment.