You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
module.exports=function(sequelize,DataTypes){returnsequelize.define('User',{// Model attributes are defined herefirstName: {type: DataTypes.STRING,allowNull: false},lastName: {type: DataTypes.STRING// allowNull defaults to true},}}
Being able to choose to define it with an instance:
module.exports=function(sequelize,DataTypes){constUser=sequelize.define('User',{// Model attributes are defined herefirstName: {type: DataTypes.STRING,allowNull: false},lastName: {type: DataTypes.STRING// allowNull defaults to true}},{// Other model options go here});// HookUser.beforeCreate(()=>{// something})returnUser;}
If that is possible to already do, where can I find that information?
The text was updated successfully, but these errors were encountered:
Instead of defining the model like this:
Being able to choose to define it with an instance:
If that is possible to already do, where can I find that information?
The text was updated successfully, but these errors were encountered: