Skip to content

Commit 37bae82

Browse files
fix: Corrects gorm table names
Crazy that this situation is not better protected.
1 parent d8e82ed commit 37bae82

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

historyStore.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,3 +91,7 @@ type gormHis struct {
9191
Ts *time.Time `gorm:"primaryKey:pk_his;index:his_pointId_ts_idx,sort:desc;index:his_ts_idx,sort:desc"`
9292
Value *float64 `gorm:"type:double precision"`
9393
}
94+
95+
func (gormHis) TableName() string {
96+
return "his"
97+
}

recStore.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,3 +99,7 @@ type gormRec struct {
9999
Dis *string
100100
Unit *string
101101
}
102+
103+
func (r gormRec) TableName() string {
104+
return "rec"
105+
}

0 commit comments

Comments
 (0)