Skip to content

Commit

Permalink
fix update0013testdata
Browse files Browse the repository at this point in the history
  • Loading branch information
Igor Polyakov committed Jun 22, 2024
1 parent 1942117 commit 708802a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions internal/app/database/update0013_update0013testdata.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package database

import (
"database/sql"
"fmt"
"log"
"log/slog"
"runtime"
Expand Down Expand Up @@ -35,8 +34,9 @@ func DatabaseUpdate_update0013_update0013testdata(db *sql.DB, getInfo bool) (str
if err := rows.Scan(&id); err != nil {
log.Fatalf("Error scanning row: %v", err)
}
query := fmt.Sprintf("UPDATE users SET display_name = '%s' WHERE id = %d", fake.Person().Name(), id)
_, err := db.Exec(query)
name := fake.Person().Name()
query := "UPDATE users SET display_name = $1 WHERE id = $2;"
_, err := db.Exec(query, name, id)
if err != nil {
slog.Error("Problem with update, query: " + query + "\n error:" + err.Error())
return fromUpdateId, toUpdateId, description, err
Expand Down

0 comments on commit 708802a

Please sign in to comment.