Skip to content

Commit

Permalink
Merge pull request #640 from Zooz/alter-jobs-script
Browse files Browse the repository at this point in the history
fix: Alter jobs script to add experiments column
  • Loading branch information
kerenfi authored Sep 21, 2023
2 parents 8f0f63e + 859808d commit 2fb4075
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/database/sequlize-handler/migrations/13_jobs_experiment.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
const Sequelize = require('sequelize');

module.exports.up = async (query, DataTypes) => {
const jobsTable = await query.describeTable('jobs');

if (!jobsTable.experiments) {
await query.addColumn(
'jobs', 'experiments',
Sequelize.DataTypes.JSON); // stringified array
}
};

module.exports.down = async (query, DataTypes) => {
await query.removeColumn('jobs', 'experiments');
};

0 comments on commit 2fb4075

Please sign in to comment.