Skip to content

Commit

Permalink
Merge pull request #6370 from NMDSdevopsServiceAdm/fix/1519-job-roles…
Browse files Browse the repository at this point in the history
…-snagging-list

added missing migration
  • Loading branch information
Jonopono123 authored Sep 26, 2024
2 parents ab22c0c + 7e3f9f7 commit 243cea6
Showing 1 changed file with 46 additions and 0 deletions.
46 changes: 46 additions & 0 deletions backend/migrations/20240926141934-renameManagerJobRole.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
'use strict';

const models = require('../server/models/index');

const jobs = [
{ id: 14, newTitle: 'Manager (care-related, but not care-providing)', oldTitle: 'Managers and staff (care-related, but not care-providing)' },
]

/** @type {import('sequelize-cli').Migration} */
module.exports = {
async up(queryInterface, Sequelize) {
return queryInterface.sequelize.transaction(async (transaction) => {
for (const job of jobs) {
await models.job.update(
{
title: job.newTitle
},
{
where: {
id: job.id,
},
transaction,
},
);
}
});
},

async down (queryInterface, Sequelize) {
return queryInterface.sequelize.transaction(async (transaction) => {
for (const job of jobs) {
await models.job.update(
{
title: job.oldTitle
},
{
where: {
id: job.id,
},
transaction,
},
);
}
});
}
};

0 comments on commit 243cea6

Please sign in to comment.