Skip to content

Commit

Permalink
fix: add migration script to jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
keren-finkelstein-payu-gpo committed Sep 21, 2023
1 parent a836d6e commit 859808d
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 859808d

Please sign in to comment.