- Set SQL connection idle limit to 1 to reduce resource usage - Explicitly define AppConfig table name to prevent GORM pluralization issues
64 lines
1.6 KiB
Go
64 lines
1.6 KiB
Go
// schema.go defines the database schema for the GORM models.
|
|
package db
|
|
|
|
import "gorm.io/gorm"
|
|
|
|
type AppConfig struct {
|
|
gorm.Model
|
|
DataDir string
|
|
AssetsDir string
|
|
EmailAddress string
|
|
LicenseKey string
|
|
SystemLevel string // BASIC, ADVANCED, ELITE, COMMERCIAL
|
|
SelectedAudioDevice string // The pipewire device name
|
|
InitialFontSize int // How large to create the font atlas
|
|
StandardFontSize int // The font size used for most text rendering
|
|
LinePattern string // "fibonacci"
|
|
AudioEnabled bool
|
|
SavedVolume float64 // Last saved volume as a percentage
|
|
FirstRun bool // Is this the first time the application has been run?
|
|
}
|
|
|
|
// Explicit table name to avoid pluralization issues
|
|
func (AppConfig) TableName() string {
|
|
return "app_configs" // Use your ACTUAL table name (check with: sqlite3 database.sqlite ".tables")
|
|
}
|
|
|
|
type Log struct {
|
|
gorm.Model
|
|
Timestamp int64
|
|
Level string
|
|
Message string
|
|
}
|
|
|
|
type Proclamation struct {
|
|
ID string `gorm:"primaryKey"`
|
|
Name string
|
|
Content string
|
|
SolfeggioFrequencyID int
|
|
CategoryID int
|
|
Selected bool
|
|
Available bool
|
|
Price float64
|
|
}
|
|
|
|
type ProclamationCategory struct {
|
|
ID int `gorm:"primaryKey"`
|
|
Name string
|
|
ParentId int
|
|
}
|
|
|
|
type SolfeggioFrequency struct {
|
|
ID int `gorm:"primaryKey"`
|
|
Name string
|
|
Value int
|
|
}
|
|
|
|
type AudioFile struct {
|
|
ID int `gorm:"primaryKey"`
|
|
Name string
|
|
Path string
|
|
Selected bool
|
|
Order int
|
|
}
|