Skip to content

Commit

Permalink
MAP-635 Add indices to improve performance of SAR queries (#682)
Browse files Browse the repository at this point in the history
  • Loading branch information
danbenton-mojdt authored Jan 31, 2024
1 parent fb08495 commit 1147bd5
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 0 deletions.
9 changes: 9 additions & 0 deletions migrations/20240131000000_form_db.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
exports.up = knex =>
knex.schema.table('statement', table => {
table.index('report_id')
})

exports.down = knex =>
knex.schema.table('statement', table => {
table.dropIndex('report_id')
})
9 changes: 9 additions & 0 deletions migrations/20240131000001_form_db.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
exports.up = knex =>
knex.schema.table('statement_amendments', table => {
table.index('statement_id')
})

exports.down = knex =>
knex.schema.table('statement_amendments', table => {
table.dropIndex('statement_id')
})
13 changes: 13 additions & 0 deletions migrations/20240131000002_form_db.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
exports.up = knex =>
knex.schema.table('report', table => {
table.index('offender_no')
table.index('created_date')
table.index('incident_date')
})

exports.down = knex =>
knex.schema.table('report', table => {
table.dropIndex('offender_no')
table.dropIndex('created_date')
table.dropIndex('incident_date')
})

0 comments on commit 1147bd5

Please sign in to comment.