mirror of
https://github.com/linuxserver/heimdalljs.git
synced 2026-02-20 05:12:24 +08:00
26 lines
492 B
JavaScript
26 lines
492 B
JavaScript
'use strict'
|
|
|
|
const { Model } = require('sequelize')
|
|
|
|
class Setting extends Model {
|
|
static init (sequelize, DataTypes) {
|
|
return super.init({
|
|
key: DataTypes.STRING,
|
|
value: {
|
|
type: DataTypes.STRING,
|
|
get () {
|
|
return JSON.parse(this.getDataValue('value'))
|
|
},
|
|
set (val) {
|
|
this.setDataValue('value', JSON.stringify(val))
|
|
}
|
|
}
|
|
}, {
|
|
sequelize,
|
|
underscored: true
|
|
})
|
|
}
|
|
}
|
|
|
|
module.exports = Setting
|