From 6d358a5183bed03db17f43d13d8ef1cb26086e53 Mon Sep 17 00:00:00 2001 From: Richard Pentecost Date: Wed, 20 Jul 2022 13:26:48 +0100 Subject: [PATCH] modify worker audit migration --- ...815-workerAuditTableAddIndexForUsername.js | 27 +++++++------------ 1 file changed, 10 insertions(+), 17 deletions(-) diff --git a/migrations/20220718113815-workerAuditTableAddIndexForUsername.js b/migrations/20220718113815-workerAuditTableAddIndexForUsername.js index cc03603b36..0c4235946c 100644 --- a/migrations/20220718113815-workerAuditTableAddIndexForUsername.js +++ b/migrations/20220718113815-workerAuditTableAddIndexForUsername.js @@ -1,23 +1,16 @@ 'use strict'; module.exports = { - up: async (queryInterface, Sequelize) => { - await queryInterface.sequelize.transaction(async (transaction) => { - await Promise.all([ - queryInterface.sequelize.query('DROP INDEX IF EXISTS cqc."worker_audit__username" ON cqc."WorkerAudit";', { - transaction, - }), - queryInterface.addIndex( - { - tableName: 'WorkerAudit', - schema: 'cqc', - }, - { - fields: ['Username'], - }, - ), - ]); - }); + up: async (queryInterface) => { + await queryInterface.addIndex( + { + tableName: 'WorkerAudit', + schema: 'cqc', + }, + { + fields: ['Username'], + }, + ); }, down: async (queryInterface) => {