feat: page links table

This commit is contained in:
Nick
2019-09-02 22:18:59 -04:00
parent ab463fcae1
commit 33e31a9901
7 changed files with 93 additions and 21 deletions

View File

@@ -64,15 +64,11 @@ module.exports = class Page extends Model {
}
},
links: {
relation: Model.ManyToManyRelation,
modelClass: Page,
relation: Model.HasManyRelation,
modelClass: require('./pageLinks'),
join: {
from: 'pages.id',
through: {
from: 'pageLinks.sourcePageId',
to: 'pageLinks.targetPageId'
},
to: 'pages.id'
to: 'pageLinks.pageId'
}
},
author: {