[add] initial commit
This commit is contained in:
19
app/models/model.go
Normal file
19
app/models/model.go
Normal file
@@ -0,0 +1,19 @@
|
||||
package models
|
||||
|
||||
import (
|
||||
"gelvin/app/application"
|
||||
)
|
||||
|
||||
type Model struct {
|
||||
app *application.Application
|
||||
}
|
||||
|
||||
func NewModel(app *application.Application) *Model {
|
||||
return &Model{
|
||||
app: app,
|
||||
}
|
||||
}
|
||||
|
||||
func Migrate(app *application.Application) error {
|
||||
return app.Db().AutoMigrate(&Sensor{}, &Measurement{})
|
||||
}
|
||||
Reference in New Issue
Block a user