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;