// Package orm define database data struct package orm import ( "time" "github.com/gofrs/uuid" ) // Measurement structure define abstracted info set of electrical measurement type Measurement struct { ID int64 `gorm:"column:id;primaryKey;autoIncrement"` Tag string `gorm:"column:tag;size:64;not null;default:''"` Name string `gorm:"column:name;size:64;not null;default:''"` Type int16 `gorm:"column:type;not null;default:-1"` Size int `gorm:"column:size;not null;default:-1"` DataSource JSONMap `gorm:"column:data_source;type:jsonb;not null;default:'{}'"` EventPlan JSONMap `gorm:"column:event_plan;type:jsonb;not null;default:'{}'"` BayUUID uuid.UUID `gorm:"column:bay_uuid;type:uuid;not null"` ComponentUUID uuid.UUID `gorm:"column:component_uuid;type:uuid;not null"` Op int `gorm:"column:op;not null;default:-1"` Ts time.Time `gorm:"column:ts;type:timestamptz;not null;default:CURRENT_TIMESTAMP"` } // TableName func respresent return table name of Measurement func (Measurement) TableName() string { return "measurement" }