Files
fasten-onprem/backend/pkg/models/system_setting_entry.go
Jason Kulatunga c85e829c46 Adding new system settings table. (#409)
* 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.
2024-02-09 09:10:06 -08:00

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"
}