31 lines
964 B
JavaScript
31 lines
964 B
JavaScript
const BaseModel = require('./BaseModel');
|
|
|
|
class User extends BaseModel {
|
|
static get tableName() {
|
|
return 'users';
|
|
}
|
|
|
|
static get idColumn() {
|
|
return 'id';
|
|
}
|
|
|
|
static get jsonSchema() {
|
|
return {
|
|
type: 'object',
|
|
properties: {
|
|
id: { type: 'integer' },
|
|
username: { type: 'string', minLength: 1, maxLength: 255 },
|
|
password: { type: 'string', minLength: 1 },
|
|
email: { type: 'string', minLength: 1, maxLength: 255 },
|
|
is_admin: { type: 'integer', default: 0 },
|
|
is_active: { type: 'integer', default: 0 },
|
|
api_key: { type: ['string', 'null'] },
|
|
created: { type: 'string', format: 'date-time' },
|
|
modified: { type: 'string', format: 'date-time' },
|
|
ignore: { type: 'integer', default: 0 }
|
|
}
|
|
};
|
|
}
|
|
}
|
|
|
|
module.exports = User; |