2017-06-26 15:03:16 +00:00
|
|
|
'use strict'
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Settings schema
|
|
|
|
*/
|
2017-07-23 03:56:46 +00:00
|
|
|
module.exports = (sequelize, DataTypes) => {
|
|
|
|
let settingSchema = sequelize.define('setting', {
|
|
|
|
key: {
|
|
|
|
type: DataTypes.STRING,
|
|
|
|
allowNull: false
|
|
|
|
},
|
|
|
|
config: {
|
|
|
|
type: DataTypes.JSONB,
|
|
|
|
allowNull: false
|
|
|
|
}
|
|
|
|
}, {
|
|
|
|
timestamps: true,
|
|
|
|
version: true,
|
|
|
|
indexes: [
|
|
|
|
{
|
|
|
|
unique: true,
|
|
|
|
fields: ['key']
|
|
|
|
}
|
|
|
|
]
|
|
|
|
})
|
2017-06-26 15:03:16 +00:00
|
|
|
|
2017-07-23 03:56:46 +00:00
|
|
|
return settingSchema
|
|
|
|
}
|