screwdriver-data-schema
Version:
Internal Data Schema of Screwdriver
27 lines (22 loc) • 684 B
JavaScript
/* eslint-disable new-cap */
;
const prefix = process.env.DATASTORE_SEQUELIZE_PREFIX || '';
const table = `${prefix}builds`;
module.exports = {
up: async (queryInterface, Sequelize) => {
await queryInterface.sequelize.transaction(async transaction => {
await queryInterface.addColumn(
table,
'templateId',
{
type: Sequelize.INTEGER
},
{ transaction }
);
await queryInterface.addIndex(table, ['templateId'], {
name: `${table}_template_id`,
transaction
});
});
}
};