mirror of
https://github.com/fastenhealth/fasten-onprem.git
synced 2026-02-17 23:48:29 -06:00
* Adding new system settings table. Adding associated database migration. Added tests Fixing tests for user-settings. * updated migration, make sure default system settings are created. Added database commands to create and update system settings. Added generic response wrapper. * make sure we can get related versions (fasten sources, onprem and desktop) when starting the app.
21 lines
802 B
Go
21 lines
802 B
Go
package models
|
|
|
|
// SystemSettingEntry matches a setting row in the database
|
|
type SystemSettingEntry struct {
|
|
//GORM attributes, see: http://gorm.io/docs/conventions.html
|
|
ModelBase
|
|
|
|
SettingKeyName string `json:"setting_key_name" gorm:"not null;index:,unique,composite:system_setting_key_name"`
|
|
SettingKeyDescription string `json:"setting_key_description"`
|
|
SettingDataType string `json:"setting_data_type"`
|
|
|
|
SettingValueNumeric int `json:"setting_value_numeric"`
|
|
SettingValueString string `json:"setting_value_string"`
|
|
SettingValueBool bool `json:"setting_value_bool"`
|
|
SettingValueArray []string `json:"setting_value_array" gorm:"column:setting_value_array;type:text;serializer:json"`
|
|
}
|
|
|
|
func (s SystemSettingEntry) TableName() string {
|
|
return "system_settings"
|
|
}
|