25 lines
946 B
JavaScript
25 lines
946 B
JavaScript
// Migration 2: Remove columns from Users
|
|
/** @type {import('sequelize-cli').Migration} */
|
|
module.exports = {
|
|
async up(queryInterface, /*Sequelize*/) {
|
|
await queryInterface.removeColumn('Users', 'height');
|
|
await queryInterface.removeColumn('Users', 'weight');
|
|
await queryInterface.removeColumn('Users', 'gender');
|
|
await queryInterface.removeColumn('Users', 'handedness');
|
|
},
|
|
|
|
async down(queryInterface, Sequelize) {
|
|
await queryInterface.addColumn('Users', 'height', {
|
|
type: Sequelize.FLOAT
|
|
});
|
|
await queryInterface.addColumn('Users', 'weight', {
|
|
type: Sequelize.FLOAT
|
|
});
|
|
await queryInterface.addColumn('Users', 'gender', {
|
|
type: Sequelize.ENUM('male', 'female', 'other')
|
|
});
|
|
await queryInterface.addColumn('Users', 'handedness', {
|
|
type: Sequelize.ENUM('left', 'right', 'both')
|
|
});
|
|
}
|
|
}; |