From f26aeca46a5b52ca9ef7e786530d70acb186158c Mon Sep 17 00:00:00 2001 From: Tom Moor Date: Sat, 26 Sep 2020 14:01:04 -0700 Subject: [PATCH] chore(migrations): Add missing indexes --- .../20200926204620-add-missing-indexes.js | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 server/migrations/20200926204620-add-missing-indexes.js diff --git a/server/migrations/20200926204620-add-missing-indexes.js b/server/migrations/20200926204620-add-missing-indexes.js new file mode 100644 index 00000000..3e730d26 --- /dev/null +++ b/server/migrations/20200926204620-add-missing-indexes.js @@ -0,0 +1,19 @@ +'use strict'; + +module.exports = { + up: async (queryInterface, Sequelize) => { + await queryInterface.addIndex("search_queries", ["teamId"]); + await queryInterface.addIndex("search_queries", ["userId"]); + await queryInterface.addIndex("search_queries", ["createdAt"]); + + await queryInterface.addIndex("users", ["teamId"]); + }, + + down: async (queryInterface, Sequelize) => { + await queryInterface.removeIndex("search_queries", ["teamId"]); + await queryInterface.removeIndex("search_queries", ["userId"]); + await queryInterface.removeIndex("search_queries", ["createdAt"]); + + await queryInterface.removeIndex("users", ["teamId"]); + } +};