VILLASweb-backend-go/simulator/model.go
smavros 64aeda36bd Database runs a small CRUD example using gorm:
- Only Simulator model is used
- The postgres Array type is provided by lib/pq
- The default empty string is fixed
2019-03-31 19:19:38 +02:00

19 lines
521 B
Go

package simulator
import (
"github.com/jinzhu/gorm"
"github.com/lib/pq"
"time"
)
type Simulator struct {
gorm.Model
UUID string `gorm:"unique;not null"`
Host string `gorm:"default:''"`
Modeltype string `gorm:"default:''"`
Uptime int `gorm:"default:0"`
State string `gorm:"default:''"`
StateUpdateAt time.Time
Properties pq.StringArray `gorm:"type:varchar(128)[]"` // TODO: mixed type
RawProperties pq.StringArray `gorm:"type:varchar(128)[]"` // TODO: mixed type
}