Search code examples
node.jsdatabaseloopback

loopback HasAndBelongsToMany relation id property in created table


when I have a HasAndBelongsToMany relation between to tables, automigration creates a new table with and id property, how can I prevent to create that?

For example:

Assembly

id: number name: string

Part

id: number name: string

AssemblyParts (automatic created table)

id: number assemblyId: number partId: number

I don't what the id property in the AssemblyParts table.


Solution

  • I doubt you can, this is a generic solution and some databases enforce/encourage to have an ID in binding tables for unique rows. This is not a major problem for you, is it?