add TAGNAME column in table grid、zone、station
This commit is contained in:
parent
f8f83c38d9
commit
349d3398b2
|
|
@ -8,6 +8,7 @@ import (
|
||||||
// Grid structure define abstracted info set of electrical grid
|
// Grid structure define abstracted info set of electrical grid
|
||||||
type Grid struct {
|
type Grid struct {
|
||||||
ID int64 `gorm:"column:ID;primaryKey"`
|
ID int64 `gorm:"column:ID;primaryKey"`
|
||||||
|
TAGNAME string `gorm:"column:TAGNAME"`
|
||||||
Name string `gorm:"column:NAME"`
|
Name string `gorm:"column:NAME"`
|
||||||
Description string `gorm:"column:DESCRIPTION"`
|
Description string `gorm:"column:DESCRIPTION"`
|
||||||
Op int `gorm:"column:OP"`
|
Op int `gorm:"column:OP"`
|
||||||
|
|
|
||||||
|
|
@ -25,19 +25,3 @@ type Measurement struct {
|
||||||
func (Measurement) TableName() string {
|
func (Measurement) TableName() string {
|
||||||
return "MEASUREMENT"
|
return "MEASUREMENT"
|
||||||
}
|
}
|
||||||
|
|
||||||
// CREATE TABLE PUBLIC.MEASUREMENT (
|
|
||||||
// ID BIGSERIAL PRIMARY KEY,
|
|
||||||
// TAG VARCHAR(64) NOT NULL DEFAULT '',
|
|
||||||
// NAME VARCHAR(64) NOT NULL DEFAULT '',
|
|
||||||
// TYPE SMALLINT NOT NULL DEFAULT -1,
|
|
||||||
// SIZE INTEGER NOT NULL DEFAULT -1,
|
|
||||||
// DATA_SOURCE JSONB NOT NULL DEFAULT '{}', -- {"type":1,"main_pos":"","sub_pos":""}
|
|
||||||
// BAY_UUID UUID NOT NULL,
|
|
||||||
// COMPONENT_UUID UUID NOT NULL,
|
|
||||||
// OP INTEGER NOT NULL DEFAULT -1,
|
|
||||||
// TS TIMESTAMPTZ NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
|
||||||
|
|
||||||
// FOREIGN KEY (BAY_UUID) REFERENCES PUBLIC.BAY (BAY_UUID),
|
|
||||||
// FOREIGN KEY (COMPONENT_UUID) REFERENCES PUBLIC.COMPONENT (GLOBAL_UUID)
|
|
||||||
// );
|
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,7 @@ import (
|
||||||
type Station struct {
|
type Station struct {
|
||||||
ID int64 `gorm:"column:ID;primaryKey"`
|
ID int64 `gorm:"column:ID;primaryKey"`
|
||||||
ZoneID int64 `gorm:"column:ZONE_ID"`
|
ZoneID int64 `gorm:"column:ZONE_ID"`
|
||||||
|
TAGNAME string `gorm:"column:TAGNAME"`
|
||||||
Name string `gorm:"column:NAME"`
|
Name string `gorm:"column:NAME"`
|
||||||
Description string `gorm:"column:DESCRIPTION"`
|
Description string `gorm:"column:DESCRIPTION"`
|
||||||
IsLocal bool `gorm:"column:IS_LOCAL"`
|
IsLocal bool `gorm:"column:IS_LOCAL"`
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,7 @@ import (
|
||||||
type Zone struct {
|
type Zone struct {
|
||||||
ID int64 `gorm:"column:ID;primaryKey"`
|
ID int64 `gorm:"column:ID;primaryKey"`
|
||||||
GridID int64 `gorm:"column:GRID_ID"`
|
GridID int64 `gorm:"column:GRID_ID"`
|
||||||
|
TAGNAME string `gorm:"column:TAGNAME"`
|
||||||
Name string `gorm:"column:NAME"`
|
Name string `gorm:"column:NAME"`
|
||||||
Description string `gorm:"column:DESCRIPTION"`
|
Description string `gorm:"column:DESCRIPTION"`
|
||||||
Op int `gorm:"column:OP"`
|
Op int `gorm:"column:OP"`
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue