n..m.joins.js 745 B

12345678910111213141516171819202122232425
  1. /**
  2. * Joins
  3. *
  4. * @type {Array}
  5. */
  6. module.exports = [
  7. {
  8. alias: 'to', // the `alias` -- e.g. name of association
  9. parent: 'message', // parent/left table name
  10. parentCollectionIdentity: 'message',
  11. parentKey: 'id', // parent PK
  12. childKey: 'message_id', // intermediate FK <- parent key
  13. child: 'message_to_user', // intermediate/right table name
  14. childCollectionIdentity: 'message_to_user'
  15. },
  16. {
  17. alias: 'to',
  18. parent: 'message_to_user', // intermediate/left table name
  19. parentCollectionIdentity: 'message_to_user',
  20. parentKey: 'user_id', // intermediate FK -> child key
  21. childKey: 'id', // child PK
  22. child: 'user', // child/right table name
  23. childCollectionIdentity: 'user'
  24. }
  25. ];