fix: JSON fields handling for MariaDB

This commit is contained in:
Nick
2019-02-09 19:10:34 -05:00
parent a8c7710412
commit b1dd54768f
35 changed files with 447 additions and 35 deletions

View File

@@ -13,17 +13,20 @@ module.exports = class Setting extends Model {
static get jsonSchema () {
return {
type: 'object',
required: ['key', 'value'],
required: ['key'],
properties: {
key: {type: 'string'},
value: {type: 'object'},
createdAt: {type: 'string'},
updatedAt: {type: 'string'}
}
}
}
static get jsonAttributes() {
return ['value']
}
$beforeUpdate() {
this.updatedAt = new Date().toISOString()
}