-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(2767): Stage must always have valid setup and teardown job IDs (#548
- Loading branch information
Showing
1 changed file
with
32 additions
and
0 deletions.
There are no files selected for viewing
32 changes: 32 additions & 0 deletions
32
migrations/20240122194105-stage_setup_teardown_required.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/* eslint-disable new-cap */ | ||
|
||
'use strict'; | ||
|
||
const prefix = process.env.DATASTORE_SEQUELIZE_PREFIX || ''; | ||
const table = `${prefix}stages`; | ||
|
||
/** @type {import('sequelize-cli').Migration} */ | ||
module.exports = { | ||
up: async (queryInterface, Sequelize) => { | ||
await queryInterface.sequelize.transaction(async transaction => { | ||
await queryInterface.changeColumn( | ||
table, | ||
'setup', | ||
{ | ||
type: Sequelize.INTEGER, | ||
allowNull: false | ||
}, | ||
{ transaction } | ||
); | ||
await queryInterface.changeColumn( | ||
table, | ||
'teardown', | ||
{ | ||
type: Sequelize.INTEGER, | ||
allowNull: false | ||
}, | ||
{ transaction } | ||
); | ||
}); | ||
} | ||
}; |