0

I have 2 domain User and Role and it has a relation to Many To Many. User has many Roles. When I run the application it creates the mapping table like role_user__user_role. I need to support legacy database where the table name is UserRole. Can anyone help me what I need to do to achieve the same?

User.js has an attribute like:

role: {
  collection: 'role',
  via: 'user'
}

and Role.js has an attribute like:

user: {
  collection: 'user',
  via: 'role'
}
Hamza Fatmi
  • 1,235
  • 8
  • 10
user9873999
  • 311
  • 3
  • 15

1 Answers1

1

You can use through associations, see here.

Hamza Fatmi
  • 1,235
  • 8
  • 10