How can we write/run the migration with sequelize-encrypted methods
Opened this issue · 1 comments
Edvinraj commented
How to add encrypted fields to existing table when run the migration(sequelize-migration)? Because we have to pass key for encryption and define some enc_fields,vault in migration file. I'm struck with those..
montalvomiguelo commented
Set your encrypted attributes as type Sequelize.BLOB
'use strict';
module.exports = {
up: (queryInterface, Sequelize) => {
return queryInterface.addColumn('users', 'encrypted', {
type: Sequelize.BLOB
});
},
down: (queryInterface, Sequelize) => {
return queryInterface.removeColumn('users', 'encrypted');
}
};