Creating instance with an association in Sequelize

Assuming you have the right association between users and login,
you can just create a user including a login:

User.create({
   name: "name",
   Login: {...}
},{
   include: Login
})

you can find more information here:
https://sequelize.org/docs/v6/advanced-association-concepts/creating-with-associations/

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)