From 9b0de4512b76a942ff5b9c6f5c4a7773e853a8a1 Mon Sep 17 00:00:00 2001 From: LandaMm Date: Sat, 24 May 2025 17:17:16 +0200 Subject: [PATCH] feat: add `profile_picture` field to user table --- migrations/00003_add_profile_image.sql | 11 +++++++++++ queries/users.sql | 5 +++++ 2 files changed, 16 insertions(+) create mode 100644 migrations/00003_add_profile_image.sql diff --git a/migrations/00003_add_profile_image.sql b/migrations/00003_add_profile_image.sql new file mode 100644 index 0000000..4658ee1 --- /dev/null +++ b/migrations/00003_add_profile_image.sql @@ -0,0 +1,11 @@ +-- +goose Up +-- +goose StatementBegin +ALTER TABLE users +ADD profile_picture TEXT; +-- +goose StatementEnd + +-- +goose Down +-- +goose StatementBegin +ALTER TABLE users +DROP COLUMN profile_picture; +-- +goose StatementEnd diff --git a/queries/users.sql b/queries/users.sql index ab5ea1f..d7e7f06 100644 --- a/queries/users.sql +++ b/queries/users.sql @@ -14,3 +14,8 @@ SELECT * FROM users WHERE email = $1 LIMIT 1; -- name: FindUserId :one SELECT * FROM users WHERE id = $1 LIMIT 1; + +-- name: UpdateProfilePicture :exec +UPDATE users +SET profile_picture = $1 +WHERE id = $2;