1.05-inbound-delivered.js 600 B

123456789101112131415
  1. module.exports = {
  2. version: 1.05,
  3. name: 'Inbound / Delivered',
  4. description: 'Removes `cartons`, refactors `scanned` to `inbound`.',
  5. up: async (queryInterface, Sequelize) => {
  6. await queryInterface.renameColumn('services', 'scanned', 'inbound')
  7. await queryInterface.renameColumn('workdays', 'cartons', 'inbound')
  8. await queryInterface.addColumn('workdays', 'delivered', Sequelize.INTEGER)
  9. await queryInterface.sequelize.query(`
  10. update services set inbound = cartons where cartons > 0
  11. `)
  12. await queryInterface.removeColumn('services', 'cartons')
  13. return 1.05
  14. }
  15. }