diff --git a/src/migrations/20191113091514-change-transaction-index-is-pending-type.js b/src/migrations/20191113091514-change-transaction-index-is-pending-type.js new file mode 100644 index 0000000..ec9b2b1 --- /dev/null +++ b/src/migrations/20191113091514-change-transaction-index-is-pending-type.js @@ -0,0 +1,23 @@ +"use strict"; + +module.exports = { + up: async (queryInterface, Sequelize) => { + await queryInterface.removeIndex("Transactions", ["isPending"]); + await queryInterface.addIndex("Transactions", [ + "isPending", + "type", + "blockNumber", + "transactionIndex" + ]); + }, + + down: async (queryInterface, Sequelize) => { + await queryInterface.removeIndex("Transactions", [ + "isPending", + "type", + "blockNumber", + "transactionIndex" + ]); + await queryInterface.addIndex("Transactions", ["isPending"]); + } +};