Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

12345678910111213141516171819202122232425262728
  1. const Schwifty = require('@hapipal/schwifty')
  2. const groupingSchema = require('../schemas/groupings')
  3. const Profile = require('./profile')
  4. module.exports = class Grouping extends Schwifty.Model {
  5. static get tableName() {
  6. return 'groupings'
  7. }
  8. static get relationMappings() {
  9. return {
  10. profiles: {
  11. relation: Schwifty.Model.ManyToManyRelation,
  12. modelClass: Profile,
  13. join: {
  14. from: 'groupings.grouping_id',
  15. through: {
  16. from: 'memberships.grouping_id',
  17. to: 'memberships.profile_id'
  18. },
  19. to: 'profiles.profile_id'
  20. },
  21. },
  22. }
  23. }
  24. static get joiSchema() {
  25. return groupingSchema.single
  26. }
  27. }