| 1234567891011121314151617181920212223242526 |
- const chalk = require('chalk')
- module.exports = {
- version: 1.01,
- name: 'Location to Terminal',
- description: 'Refactors `Location` to `Terminal`',
- up: async (queryInterface, Sequelize) => {
- // Tables with locationId:
- // Retailer
- // Service
- // StaffMember
- // Workday
- console.log(chalk.red('Renaming locationId -> terminalId on retailers'))
- await queryInterface.renameColumn('retailers', 'locationId', 'terminalId')
- console.log(chalk.red('Renaming locationId -> terminalId on staffMembers'))
- await queryInterface.renameColumn('staffMembers', 'locationId', 'terminalId')
- console.log(chalk.red('Renaming locationId -> terminalId on workdays'))
- await queryInterface.renameColumn('workdays', 'locationId', 'terminalId')
- console.log(chalk.red('Renaming table locations -> terminals'))
- await queryInterface.renameTable('locations', 'terminals')
- return 1.01
- }
- }
|