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

123456789101112131415161718192021222324252627
  1. const Schwifty = require('@hapipal/schwifty')
  2. const Joi = require('joi')
  3. const Response = require('./response')
  4. module.exports = class Profile extends Schwifty.Model {
  5. static get tableName() {
  6. return 'profiles'
  7. }
  8. static get relationMappings() {
  9. return {
  10. responses: {
  11. relation: Schwifty.Model.HasManyRelation,
  12. modelClass: Response,
  13. join: {
  14. from: 'responses.profile_id',
  15. to: 'profiles.profile_id',
  16. },
  17. },
  18. }
  19. }
  20. static get joiSchema() {
  21. return Joi.object({
  22. profile_id: Joi.number(),
  23. user_id: Joi.number(),
  24. })
  25. }
  26. }