Skip to content
Advertisement

How to fill the middle table of an n:m association with the methode fooInstance.createBar() with Sequelize

I want to fill the data into a N:M jointure table with the methods provided by sequelize. As my data is in allowNull: false, i can’t add the data afterward :/

Here an exemple of code/BDD:

UML

my table a:

JavaScript

my table b:

JavaScript

my table c:

JavaScript

I want to be able to do something like this:

JavaScript

How can i achieve something like that???

Thx for your time and answers!

Advertisement

Answer

You should indicate through option like this:

JavaScript

See Advanced Many-to-Many

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement