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.
13 lines
287 B
JavaScript
13 lines
287 B
JavaScript
var bookshelf = require('../bookshelf');
|
|
bookshelf.plugin('registry');
|
|
var Article = require('./article');
|
|
|
|
var Topic = bookshelf.Model.extend({
|
|
tableName: 'topics',
|
|
articles: function() {
|
|
return this.hasMany('Article');
|
|
}
|
|
});
|
|
|
|
module.exports = bookshelf.model('Topic',Topic);
|