Skip to content

Commit

Permalink
fix: delete one memo will delete all memos on pgsql (#2611)
Browse files Browse the repository at this point in the history
fix: delete single memo will all memos on pgsql

Close #2605
  • Loading branch information
Cologler authored Dec 12, 2023
1 parent ec79925 commit 6bda640
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion store/db/postgres/memo.go
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,8 @@ func (d *DB) DeleteMemo(ctx context.Context, delete *store.DeleteMemo) error {

func vacuumMemo(ctx context.Context, tx *sql.Tx) error {
// First, build the subquery
subQuery, subArgs, err := squirrel.Select("id").From("user").PlaceholderFormat(squirrel.Dollar).ToSql()
// select from user is select the DB users, not the memos users.
subQuery, subArgs, err := squirrel.Select("id").From("public.user").PlaceholderFormat(squirrel.Dollar).ToSql()
if err != nil {
return err
}
Expand Down

0 comments on commit 6bda640

Please sign in to comment.