Skip to content

Commit e58fff0

Browse files
Fix: state repository realization
1 parent bb64304 commit e58fff0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

database/pg.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,12 +75,12 @@ func (db *PgGo) CreateState(s State) error {
7575

7676
// UpdateState -
7777
func (db *PgGo) UpdateState(s State) error {
78-
_, err := db.conn.Model(&s).WherePK().Update()
78+
_, err := db.conn.Model(&s).Where("index_name = ?", s.IndexName).Update()
7979
return err
8080
}
8181

8282
// DeleteState -
8383
func (db *PgGo) DeleteState(s State) error {
84-
_, err := db.conn.Model(&s).WherePK().Delete()
84+
_, err := db.conn.Model(&s).Where("index_name = ?", s.IndexName).Delete()
8585
return err
8686
}

0 commit comments

Comments
 (0)