fix: JSON fields handling for MariaDB
This commit is contained in:
@@ -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()
|
||||
}
|
||||
|
Reference in New Issue
Block a user