diff --git a/go/data/study.go b/go/data/study.go index 9521a6a..d0b212f 100644 --- a/go/data/study.go +++ b/go/data/study.go @@ -296,7 +296,7 @@ func (s *Study) Put(ref *Reference) error { return err } if err := func() error { - _, err := tx.Exec("INSERT INTO OBJ (ID, DATA) VALUES (?, ?)", []byte(ref.Name), b) + _, err := tx.Exec("INSERT INTO OBJ (ID, DATA) VALUES (?, ?) ON CONFLICT (ID) DO UPDATE SET DATA = ?", []byte(ref.Name), b, b) return err }(); err != nil { if rerr := tx.Rollback(); rerr != nil {