add migrations for new table, columns and modified column names

This commit is contained in:
Bilal Catic
2019-06-09 11:36:34 +02:00
parent 0a712bf501
commit c021b55c26
4 changed files with 103 additions and 0 deletions

View File

@@ -0,0 +1,27 @@
'use strict';
module.exports = {
up: (queryInterface, Sequelize) => {
return queryInterface.sequelize.transaction((t) => {
return Promise.all([
queryInterface.addColumn('bookingReservations', 'timezone', {
type: Sequelize.TEXT,
after: 'end'
}),
queryInterface.addColumn('bookingReservations', 'canceled', {
type: Sequelize.BOOLEAN,
after: 'timezone'
})
]);
});
},
down: (queryInterface, Sequelize) => {
return queryInterface.sequelize.transaction((t) => {
return Promise.all([
queryInterface.removeColumn('bookingReservations', 'canceled'),
queryInterface.removeColumn('bookingReservations', 'timezone')
]);
});
}
};