Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

12345678910111213141516171819202122232425262728
  1. const Schwifty = require('@hapipal/schwifty')
  2. const User = require('./user')
  3. const queueSchema = require('../schemas/queues')
  4. module.exports = class MatchQueue extends Schwifty.Model {
  5. static get tableName() {
  6. return 'match_queues'
  7. }
  8. static get relationMappings() {
  9. return {
  10. user: {
  11. relation: Schwifty.Model.HasOneThroughRelation,
  12. modelClass: User,
  13. join: {
  14. from: 'match_queues.target_id',
  15. through: {
  16. from: 'profiles.profile_id',
  17. to: 'profiles.user_id',
  18. },
  19. to: 'users.user_id',
  20. },
  21. },
  22. }
  23. }
  24. static get joiSchema() {
  25. return queueSchema.single
  26. }
  27. }