sequelize add not null constraint

Solutions on MaxInterview for sequelize add not null constraint by the best coders in the world

showing results for - "sequelize add not null constraint"
Garry
09 Jun 2019
1module.exports = {
2    up: (queryInterface, Sequelize) => {
3        return queryInterface.changeColumn('users', 'active', {
4            type: Sequelize.BOOLEAN,
5            allowNull: false,
6            defaultValue: false,
7        })
8    },
9    down: (queryInterface, Sequelize) => {
10        return queryInterface.changeColumn('users', 'active', {
11            type: Sequelize.BOOLEAN,
12        });
13    }
14};