Added result model; added form to submit results

This commit is contained in:
Gregory Ballantine
2024-05-29 11:25:45 -04:00
parent 7e294c8f72
commit 9df8f6c9e1
3 changed files with 59 additions and 1 deletions

View File

@ -21,6 +21,6 @@ func Open() {
}
// Migrate the schema
DB.AutoMigrate(&Test{}, &Hardware{}, &Benchmark{})
DB.AutoMigrate(&Test{}, &Hardware{}, &Benchmark{}, &Result{})
log.Println("Database migrations complete.")
}

23
models/result.go Normal file
View File

@ -0,0 +1,23 @@
package models
import (
"gorm.io/gorm"
)
type Test struct {
gorm.Model
Name string
Description string
// belongs to Hardware
HardwareID int
Hardware Hardware
// belongs to Benchmark
BenchmarkID int
Benchmark Benchmark
// belongs to Test
TestID int
Test Test
}