Skip to content

Commit

Permalink
Merge pull request #2225 from HHS/mb/TTAHUB-3123/update-tr-status
Browse files Browse the repository at this point in the history
  • Loading branch information
thewatermethod authored Jun 24, 2024
2 parents b8ac604 + c0d30c4 commit 4714900
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions src/migrations/20240624185931-unlock-tr-and-sessions.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
const {
prepMigration,
} = require('../lib/migration');

module.exports = {
up: async (queryInterface) => queryInterface.sequelize.transaction(
async (transaction) => {
await prepMigration(queryInterface, transaction, __filename);
await queryInterface.sequelize.query(/* sql */`
UPDATE "SessionReportPilots"
SET data = jsonb_set(data, '{status}', '"In progress"', true)
WHERE "eventId" = 48;
UPDATE "EventReportPilots"
SET data = jsonb_set(data, '{status}', '"In progress"', true)
WHERE "id" = 48;
`, { transaction });
},
),

down: async (queryInterface) => queryInterface.sequelize.transaction(
async (transaction) => {
await prepMigration(queryInterface, transaction, __filename);
// No down migration needed here
},
),
};

0 comments on commit 4714900

Please sign in to comment.