misc: migrated json filters to new op

This commit is contained in:
Sheen Capadngan
2024-10-03 00:31:23 +08:00
parent dc8c3a30bd
commit 9b1615f2fb
2 changed files with 9 additions and 2 deletions
@@ -8,8 +8,14 @@ export async function up(knex: Knex): Promise<void> {
`CREATE INDEX "audit_logs_actorMetadata_idx" ON ${TableName.AuditLog} USING gin("actorMetadata" jsonb_path_ops)`
);
}
if (await knex.schema.hasColumn(TableName.AuditLog, "eventMetadata")) {
await knex.raw(
`CREATE INDEX "audit_logs_eventMetadata_idx" ON ${TableName.AuditLog} USING gin("eventMetadata" jsonb_path_ops)`
);
}
}
export async function down(knex: Knex): Promise<void> {
await knex.raw(`DROP INDEX IF EXISTS "audit_logs_actorMetadata_idx"`);
await knex.raw(`DROP INDEX IF EXISTS "audit_logs_eventMetadata_idx"`);
}