Skip to content

Commit

Permalink
include migration and seeder
Browse files Browse the repository at this point in the history
  • Loading branch information
outofambit committed Nov 21, 2024
1 parent eb81cab commit af1a44e
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 0 deletions.
16 changes: 16 additions & 0 deletions server/migrations/20241121003538-addAutomationServiceColumn.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
'use strict';

/** @type {import('sequelize-cli').Migration} */
module.exports = {
async up(queryInterface, Sequelize) {
await queryInterface.addColumn('TestPlanRun', 'automationService', {
type: Sequelize.STRING,
allowNull: true,
defaultValue: null
});
},

async down(queryInterface) {
await queryInterface.removeColumn('TestPlanRun', 'automationService');
}
};
31 changes: 31 additions & 0 deletions server/seeders/20241121004144-populateAutomationServiceColumn.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
'use strict';

/** @type {import('sequelize-cli').Migration} */
module.exports = {
async up(queryInterface) {
/**
* Add seed commands here.
*
* Example:
* await queryInterface.bulkInsert('People', [{
* name: 'John Doe',
* isBetaMember: false
* }], {});
*/
await queryInterface.bulkUpdate('TestPlanRun', {
automationService: 'GITHUB_ACTIONS'
});
},

async down(queryInterface) {
/**
* Add commands to revert seed here.
*
* Example:
* await queryInterface.bulkDelete('People', null, {});
*/
await queryInterface.bulkUpdate('TestPlanRun', {
automationService: null
});
}
};

0 comments on commit af1a44e

Please sign in to comment.