Skip to content

Commit

Permalink
Update migrations to support future migrations when migrating from th…
Browse files Browse the repository at this point in the history
…is as the initial point
  • Loading branch information
howard-e committed Aug 1, 2023
1 parent 252e896 commit f5478f4
Show file tree
Hide file tree
Showing 4 changed files with 460 additions and 30 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ const {
const conflictsResolver = require('../resolvers/TestPlanReport/conflictsResolver');
const BrowserLoader = require('../models/loaders/BrowserLoader');
const AtLoader = require('../models/loaders/AtLoader');
const { TEST_PLAN_REPORT_ATTRIBUTES } = require('../models/services/helpers');

module.exports = {
up: queryInterface => {
Expand Down Expand Up @@ -138,14 +139,20 @@ module.exports = {
}
}

// Exclude certain attributes called in testPlanReport query;
// needed to support future migrations
const testPlanReportAttributes = TEST_PLAN_REPORT_ATTRIBUTES.filter(
e => !['approvedAt'].includes(e)
);

for (let i = 0; i < testPlanReportsData.length; i++) {
const testPlanReportId = testPlanReportsData[i].id;
const status = testPlanReportsData[i].status;
if (status === 'DRAFT') {
let updateParams = {};
const testPlanReport = await getTestPlanReportById(
testPlanReportId,
null,
testPlanReportAttributes,
null,
['id', 'tests']
);
Expand Down
Loading

0 comments on commit f5478f4

Please sign in to comment.