webhooks and chirps by user id

This commit is contained in:
2025-03-13 22:47:03 +02:00
parent bad1d140ee
commit 66be0a2b40
13 changed files with 195 additions and 24 deletions

View File

@@ -0,0 +1,2 @@
-- name: GetChirpsByUserID :many
SELECT * FROM chirps WHERE user_id = $1 ORDER BY created_at;

View File

@@ -0,0 +1,3 @@
-- name: UpgradeUserToChirpyRed :exec
UPDATE users SET is_chirpy_red = true WHERE id = $1
RETURNING *;

View File

@@ -0,0 +1,5 @@
-- +goose Up
ALTER TABLE users ADD COLUMN is_chirpy_red BOOLEAN NOT NULL DEFAULT false;
-- +goose Down
ALTER TABLE users DROP COLUMN is_chirpy_red;