mirror of https://github.com/requarks/wiki
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
35 lines
660 B
35 lines
660 B
const Model = require('objection').Model
|
|
|
|
/**
|
|
* Users model
|
|
*/
|
|
module.exports = class PageLink extends Model {
|
|
static get tableName() { return 'pageLinks' }
|
|
|
|
static get jsonSchema () {
|
|
return {
|
|
type: 'object',
|
|
required: ['path', 'localeCode'],
|
|
|
|
properties: {
|
|
id: {type: 'integer'},
|
|
path: {type: 'string'},
|
|
localeCode: {type: 'string'}
|
|
}
|
|
}
|
|
}
|
|
|
|
static get relationMappings() {
|
|
return {
|
|
page: {
|
|
relation: Model.BelongsToOneRelation,
|
|
modelClass: require('./pages'),
|
|
join: {
|
|
from: 'pageLinks.pageId',
|
|
to: 'pages.id'
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|