diff --git a/app/models/reports/kbMatchJoin.js b/app/models/reports/kbMatchJoin.js index ce2e7daf4..1195cf30f 100644 --- a/app/models/reports/kbMatchJoin.js +++ b/app/models/reports/kbMatchJoin.js @@ -38,6 +38,16 @@ module.exports = (sequelize, Sq) => { }, }, }, + indexes: [ + { + name: 'idx_kb_match_id_join', + fields: ['kb_match_id'], + }, + { + name: 'idx_kb_matched_statement_id_join', + fields: ['kb_matched_statement_id'], + }, + ], }, ); }; diff --git a/migrations/20241112211455-DEVSU-2483-add-kb-match-index.js b/migrations/20241112211455-DEVSU-2483-add-kb-match-index.js new file mode 100644 index 000000000..20ac2e91c --- /dev/null +++ b/migrations/20241112211455-DEVSU-2483-add-kb-match-index.js @@ -0,0 +1,14 @@ +module.exports = { + up: async (queryInterface) => { + await queryInterface.addIndex('reports_kb_match_join', ['kb_match_id'], { + name: 'idx_kb_match_id_join', + }); + await queryInterface.addIndex('reports_kb_match_join', ['kb_matched_statement_id'], { + name: 'idx_kb_matched_statement_id_join', + }); + }, + + down: async () => { + throw new Error('Not Implemented!'); + }, +};