fix: JSON fields handling for MariaDB

This commit is contained in:
Nick committed 2019-02-09 19:10:34 -05:00
1 parent a8c7710412
commit b1dd54768f
35 files changed
+447 -35

No files matched your search

+5 -2
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()
}