Skip to content

Commit

Permalink
hotfix
Browse files Browse the repository at this point in the history
  • Loading branch information
wtks committed May 21, 2020
1 parent bf082b4 commit 152133a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions cmd/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,7 @@ func (c Config) getDatabase() (*gorm.DB, error) {
engine.DB().SetMaxOpenConns(c.MariaDB.Connection.MaxOpen)
engine.DB().SetMaxIdleConns(c.MariaDB.Connection.MaxIdle)
engine.DB().SetConnMaxLifetime(time.Duration(c.MariaDB.Connection.LifeTime) * time.Second)
engine.BlockGlobalUpdate(true)
engine.LogMode(c.DevMode)
return engine.Set("gorm:table_options", "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4"), nil
}
Expand Down
2 changes: 1 addition & 1 deletion repository/pin_impl.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ func (repo *GormRepository) UnpinMessage(messageID, userID uuid.UUID) error {
return err
}
ok = true
return tx.Delete(&model.Pin{MessageID: messageID}).Error
return tx.Delete(model.Pin{}, &model.Pin{MessageID: messageID}).Error
})
if err != nil {
return err
Expand Down

0 comments on commit 152133a

Please sign in to comment.