make difference between door lock charges related to reservations and standalone incidents

This commit is contained in:
Bilal Catic
2019-07-07 00:28:39 +02:00
parent 72bb874d85
commit 5d3653cd65
8 changed files with 162 additions and 84 deletions

View File

@@ -0,0 +1,14 @@
'use strict';
module.exports = {
up: (queryInterface, Sequelize) => {
return queryInterface.addColumn('unlockedIncidents', 'unlockTimestamp', {
type: Sequelize.DATE,
after: 'bookingEnd'
});
},
down: (queryInterface, Sequelize) => {
return queryInterface.removeColumn('unlockedIncidents', 'unlockTimestamp');
}
};

View File

@@ -0,0 +1,27 @@
'use strict';
module.exports = {
up: (queryInterface, Sequelize) => {
return queryInterface.sequelize.transaction((t) => {
return Promise.all([
queryInterface.addColumn('unscheduledIncidents', 'unlockTimestamp', {
type: Sequelize.DATE,
after: 'bookingEnd'
}),
queryInterface.addColumn('unscheduledIncidents', 'lockTimestamp', {
type: Sequelize.DATE,
after: 'unlockTimestamp'
})
]);
});
},
down: (queryInterface, Sequelize) => {
return queryInterface.sequelize.transaction((t) => {
return Promise.all([
queryInterface.removeColumn('unscheduledIncidents', 'lockTimestamp'),
queryInterface.removeColumn('unscheduledIncidents', 'unlockTimestamp')
]);
});
}
};