This repository has been archived on 2026-06-29. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
spellsaurus/api/models/school-model.js
2020-08-09 15:27:22 +02:00

17 lines
423 B
JavaScript

'use strict'
const bookshelf = require('../database/bookshelf').bookshelf
require('./spell-model')
require('./meta-school-model')
let School = bookshelf.Model.extend({
tableName: 'school',
spells() {
return this.belongsToMany( 'Spell', 'spell_school' )
},
meta_schools() {
return this.belongsTo( 'MetaSchool', 'meta_school_id' )
}
})
module.exports = bookshelf.model('School', School)