Skip to content

Commit

Permalink
Merge pull request #5105 from NMDSdevopsServiceAdm/fix/indexMigration
Browse files Browse the repository at this point in the history
modify worker audit migration
  • Loading branch information
Richard-Pentecost authored Jul 20, 2022
2 parents b1ce73b + 6d358a5 commit 57e91a3
Showing 1 changed file with 10 additions and 17 deletions.
27 changes: 10 additions & 17 deletions migrations/20220718113815-workerAuditTableAddIndexForUsername.js
Original file line number Diff line number Diff line change
@@ -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) => {
Expand Down

0 comments on commit 57e91a3

Please sign in to comment.