21 lines
510 B
JavaScript
21 lines
510 B
JavaScript
'use strict';
|
|
const { Model } = require('objection');
|
|
|
|
class UserSessions extends Model {
|
|
static get tableName() { return 'user_sessions'; }
|
|
static get idColumn() { return 'id'; }
|
|
static get jsonSchema() {
|
|
return {
|
|
type : 'object',
|
|
required : ['user_id','token','expiration'],
|
|
properties : {
|
|
user_id : { type : 'integer' , minimum : 0 },
|
|
token: { type: 'string' , maxLength : 256 },
|
|
expiration: { type: 'string' },
|
|
}
|
|
};
|
|
}
|
|
}
|
|
|
|
module.exports = UserSessions;
|