I have this ternary relationship:

I want to implement it into Sequelize but I couldn't find any docs on how to do it.
I was thinking about adding an ID field in ProfesoriClasa, then creating another pivot table, like this:

would this approach be fine? Or is there any other way to implement that ternary relationship using Sequelize?
Thanks.