99af2b8b16
- updated dbdiagrams schema - [BREAKING] force failure if `notify.filter_attributes` or `notify.level` is set - added Settings table (and default values during migration) - Added Save Settings and Get Settings functions. - Added web API endpoints for getting and saving settings. - Deprecated old Notify* constants. Created new MetricsStatus* and MetricsNotifyLevel constants.
23 lines
584 B
Go
23 lines
584 B
Go
package models
|
|
|
|
import (
|
|
"gorm.io/gorm"
|
|
)
|
|
|
|
// SettingEntry matches a setting row in the database
|
|
type SettingEntry struct {
|
|
//GORM attributes, see: http://gorm.io/docs/conventions.html
|
|
gorm.Model
|
|
|
|
SettingKeyName string `json:"setting_key_name" gorm:"unique;not null"`
|
|
SettingKeyDescription string `json:"setting_key_description"`
|
|
SettingDataType string `json:"setting_data_type"`
|
|
|
|
SettingValueNumeric int64 `json:"setting_value_numeric"`
|
|
SettingValueString string `json:"setting_value_string"`
|
|
}
|
|
|
|
func (s SettingEntry) TableName() string {
|
|
return "settings"
|
|
}
|