Skip to content

Commit 8180aca

Browse files
Fix: gorm comments
1 parent 421296b commit 8180aca

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

database/gorm.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import (
88
"time"
99

1010
"github.com/dipdup-net/go-lib/config"
11-
pg "github.com/go-pg/pg/v10"
1211
"github.com/pkg/errors"
1312
"gorm.io/driver/mysql"
1413
"gorm.io/driver/postgres"
@@ -131,15 +130,15 @@ func (db *Gorm) DeleteState(ctx context.Context, s *State) error {
131130
func (db *Gorm) MakeTableComment(ctx context.Context, name string, comment string) error {
132131
return db.conn.WithContext(ctx).Exec(
133132
`COMMENT ON TABLE ? IS ?`,
134-
pg.Safe(name),
133+
name,
135134
comment).Error
136135
}
137136

138137
// MakeColumnComment -
139138
func (db *Gorm) MakeColumnComment(ctx context.Context, tableName string, columnName string, comment string) error {
140139
return db.conn.WithContext(ctx).Exec(
141140
`COMMENT ON COLUMN ?.? IS ?`,
142-
pg.Safe(tableName),
143-
pg.Safe(columnName),
141+
tableName,
142+
columnName,
144143
comment).Error
145144
}

0 commit comments

Comments
 (0)