Implicite Many-to-Many relationship double primary key
Implicite Many-to-Many relationship with two models, but one of these two models has a double primary key?
Solution
Here is an example of how you can define an explicit many-to-many relation based off of your example
In this schema,
In this schema,
KitRole acts as the relation table between Kit and Role. The @@id([kitid, roleid, guildid]) in KitRole ensures that the combination of kitid, roleid, and guildid is unique. This allows you to store additional fields on the relation if needed and properly handles the composite primary key in the Role model.