@teikei/api
Version:
Teikei API server. Teikei is the software that powers ernte-teilen.org, a website that maps out Community-supported Agriculture in Germany.
26 lines (22 loc) • 517 B
JavaScript
import { BaseModel } from '../base'
export default class User extends BaseModel {
static tableName = 'users'
// eslint-disable-next-line class-methods-use-this
type() {
return 'User'
}
static relationMappings = {
roles: {
relation: BaseModel.ManyToManyRelation,
modelClass: `${__dirname}/roles`,
join: {
from: 'users.id',
through: {
from: 'users_roles.user_id',
to: 'users_roles.role_id'
},
to: 'roles.id'
}
}
}
}