From 2bcf37fd83e4680e2cca8bf43f007b5904541aba Mon Sep 17 00:00:00 2001 From: Jori Lallo Date: Sat, 25 Jun 2016 23:40:08 -0700 Subject: [PATCH] Added indexes --- .../20160626063409-unnamed-migration.js | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 server/migrations/20160626063409-unnamed-migration.js diff --git a/server/migrations/20160626063409-unnamed-migration.js b/server/migrations/20160626063409-unnamed-migration.js new file mode 100644 index 000000000..6d886bd5c --- /dev/null +++ b/server/migrations/20160626063409-unnamed-migration.js @@ -0,0 +1,29 @@ +'use strict'; + +module.exports = { + up: function (queryInterface, Sequelize) { + queryInterface.addIndex('documents', ['urlId']); + queryInterface.addIndex('documents', ['id', 'atlasId']); + queryInterface.addIndex('documents', ['id', 'teamId']); + queryInterface.addIndex('documents', ['parentDocumentId', 'atlasId']); + + queryInterface.addIndex('atlases', ['id', 'teamId']); + + queryInterface.addIndex('teams', ['slackId']); + + queryInterface.addIndex('users', ['slackId']); + }, + + down: function (queryInterface, Sequelize) { + queryInterface.removeIndex('documents', ['urlId']); + queryInterface.removeIndex('documents', ['id', 'atlasId']); + queryInterface.removeIndex('documents', ['id', 'teamId']); + queryInterface.removeIndex('documents', ['parentDocumentId', 'atlasId']); + + queryInterface.removeIndex('atlases', ['id', 'teamId']); + + queryInterface.removeIndex('teams', ['slackId']); + + queryInterface.removeIndex('users', ['slackId']); + } +};