File dump from old repo

This commit is contained in:
Alexis
2021-07-18 15:48:01 +02:00
parent 1d0c7dab8b
commit c7c24a30a0
43 changed files with 7368 additions and 0 deletions

17
models/user-model.js Normal file
View File

@@ -0,0 +1,17 @@
const bookshelf = require('../database/bookshelf').bookshelf;
require('./role-model');
require('./spell-model');
let User = bookshelf.Model.extend({
tableName: 'user',
hidden: ['password', 'role_id'],
role() {
return this.belongsTo('Role');
},
spells() {
return this.hasMany('Spell', 'author_id');
}
});
module.exports = bookshelf.model('User', User);