I have created "blogs" table with id(primary key), title ,created at ,updated at , status (with enum type having values "active,inactive,hidden" with default value "active")
create function on Blog Model is working fine when giving status value from above mentioned set of values and empty value
const Blog = sequelize.define('blog', { id: { type:
Sequelize.INTEGER,
primaryKey: true, autoIncrement: true }, text: Sequelize.STRING,
status : { type : Sequelize.ENUM, allowNull : false, values :
['Inactive','Active','Hidden'], defaultValue : 'Active' } });
Blog.create({"title" :"hello","status":"abc"}).then(result => {
console.log(result);
});
The above code inserted a new record in blogs table with status of empty value.but result object having status of "abc".How can I get newly inserted record ?