Added result model; added form to submit results
This commit is contained in:
@ -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
23
models/result.go
Normal 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
|
||||
}
|
Reference in New Issue
Block a user