add TAGNAME column in table grid、zone、station

This commit is contained in:
douxu 2025-08-26 17:09:49 +08:00
parent f8f83c38d9
commit 349d3398b2
4 changed files with 3 additions and 16 deletions

View File

@ -8,6 +8,7 @@ import (
// Grid structure define abstracted info set of electrical grid
type Grid struct {
ID int64 `gorm:"column:ID;primaryKey"`
TAGNAME string `gorm:"column:TAGNAME"`
Name string `gorm:"column:NAME"`
Description string `gorm:"column:DESCRIPTION"`
Op int `gorm:"column:OP"`

View File

@ -25,19 +25,3 @@ type Measurement struct {
func (Measurement) TableName() string {
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)
// );

View File

@ -9,6 +9,7 @@ import (
type Station struct {
ID int64 `gorm:"column:ID;primaryKey"`
ZoneID int64 `gorm:"column:ZONE_ID"`
TAGNAME string `gorm:"column:TAGNAME"`
Name string `gorm:"column:NAME"`
Description string `gorm:"column:DESCRIPTION"`
IsLocal bool `gorm:"column:IS_LOCAL"`

View File

@ -9,6 +9,7 @@ import (
type Zone struct {
ID int64 `gorm:"column:ID;primaryKey"`
GridID int64 `gorm:"column:GRID_ID"`
TAGNAME string `gorm:"column:TAGNAME"`
Name string `gorm:"column:NAME"`
Description string `gorm:"column:DESCRIPTION"`
Op int `gorm:"column:OP"`