Skip to content
Snippets Groups Projects

Fix relationship from users to ephemerals

1 open thread
1 file
+ 1
4
Compare changes
  • Side-by-side
  • Inline
+ 1
4
@@ -11,7 +11,6 @@ package storage
@@ -11,7 +11,6 @@ package storage
import (
import (
"github.com/pkg/errors"
"github.com/pkg/errors"
"gorm.io/gorm"
"gorm.io/gorm"
"gorm.io/gorm/clause"
)
)
// Obtain User from backend by primary key
// Obtain User from backend by primary key
@@ -69,9 +68,7 @@ func (impl *DatabaseImpl) GetAllUsers() ([]*User, error) {
@@ -69,9 +68,7 @@ func (impl *DatabaseImpl) GetAllUsers() ([]*User, error) {
}
}
func (impl *DatabaseImpl) upsertEphemeral(ephemeral *Ephemeral) error {
func (impl *DatabaseImpl) upsertEphemeral(ephemeral *Ephemeral) error {
return impl.db.Clauses(clause.OnConflict{
return impl.db.Create(&ephemeral).Error
UpdateAll: true,
}).Create(&ephemeral).Error
}
}
func (impl *DatabaseImpl) GetEphemeral(ephemeralId int64) ([]*Ephemeral, error) {
func (impl *DatabaseImpl) GetEphemeral(ephemeralId int64) ([]*Ephemeral, error) {
Loading