You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Matterwiki/models/article.js

13 lines
296 B
JavaScript

var bookshelf = require('../bookshelf');
bookshelf.plugin('registry');
var Topic = require('./topic');
var Article = bookshelf.Model.extend({
tableName: 'articles',
topic: function() {
return this.hasOne('Topic','topic_id');
}
});
module.exports = bookshelf.model('Article',Article);