Hello guys, what is the way to add an single entity to a table with a relationship one-to-many? I've a Entity1 1:n Entity2, I'm trying to add some data with a transaction:
// Result is whatever you returned inside the transaction
let result = await sequelize.transaction(async (transaction) => {
let aDB = await A.create(data, transaction);
let bdata = {
aId:
aDB.id }
let bDB = await B.create(bdata, transaction);
// ^^^^ Crash here! Field 'aId' doesn't have a default value
});