New field in Users table for avatar and bio.
This commit is contained in:
39
migrations/20220301193849-modify_users_add_fields.js
Normal file
39
migrations/20220301193849-modify_users_add_fields.js
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
'use strict';
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
async up (queryInterface, Sequelize) {
|
||||||
|
/**
|
||||||
|
* Add altering commands here.
|
||||||
|
*
|
||||||
|
* Example:
|
||||||
|
* await queryInterface.createTable('users', { id: Sequelize.INTEGER });
|
||||||
|
*/
|
||||||
|
await queryInterface.addColumn(
|
||||||
|
'Users',
|
||||||
|
'avatar',
|
||||||
|
{
|
||||||
|
type: Sequelize.BLOB,
|
||||||
|
allowNull: true,
|
||||||
|
},
|
||||||
|
);
|
||||||
|
await queryInterface.addColumn(
|
||||||
|
'Users',
|
||||||
|
'bio',
|
||||||
|
{
|
||||||
|
type: Sequelize.TEXT,
|
||||||
|
allowNull: true,
|
||||||
|
}
|
||||||
|
);
|
||||||
|
},
|
||||||
|
|
||||||
|
async down (queryInterface, Sequelize) {
|
||||||
|
/**
|
||||||
|
* Add reverting commands here.
|
||||||
|
*
|
||||||
|
* Example:
|
||||||
|
* await queryInterface.dropTable('users');
|
||||||
|
*/
|
||||||
|
await queryInterface.removeColumn('Users', 'avatar');
|
||||||
|
await queryInterface.removeColumn('Users', 'bio');
|
||||||
|
}
|
||||||
|
};
|
Reference in New Issue
Block a user