diff --git a/src/database/sequlize-handler/migrations/13_jobs_experiment.js b/src/database/sequlize-handler/migrations/13_jobs_experiment.js new file mode 100644 index 00000000..4d1498c5 --- /dev/null +++ b/src/database/sequlize-handler/migrations/13_jobs_experiment.js @@ -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'); +};