Add post video storage.
CI / test (pull_request) Successful in 6m29s

This commit is contained in:
2026-08-30 21:35:03 -07:00
parent 2eb8bff1c4
commit 4e31f2dc6e
8 changed files with 144 additions and 21 deletions
+9 -4
View File
@@ -59,7 +59,7 @@ func (q *Queries) CreatePost(ctx context.Context, arg CreatePostParams) error {
const createPostImage = `-- name: CreatePostImage :exec
INSERT INTO post_images (
id, post_id, object_key, public_url, description, position, width, height, created_at
id, post_id, object_key, public_url, description, kind, position, width, height, created_at
)
VALUES (
$1,
@@ -70,7 +70,8 @@ VALUES (
$6,
$7,
$8,
$9
$9,
$10
)
`
@@ -80,6 +81,7 @@ type CreatePostImageParams struct {
ObjectKey string
PublicUrl string
Description string
Kind string
Position int16
Width int32
Height int32
@@ -93,6 +95,7 @@ func (q *Queries) CreatePostImage(ctx context.Context, arg CreatePostImageParams
arg.ObjectKey,
arg.PublicUrl,
arg.Description,
arg.Kind,
arg.Position,
arg.Width,
arg.Height,
@@ -201,7 +204,7 @@ func (q *Queries) GetRootPostVoteSummary(ctx context.Context, arg GetRootPostVot
const listPostImages = `-- name: ListPostImages :many
SELECT
id, post_id, object_key, public_url, description, position, width, height, created_at
id, post_id, object_key, public_url, description, kind, position, width, height, created_at
FROM post_images
WHERE post_id = $1
ORDER BY position
@@ -222,6 +225,7 @@ func (q *Queries) ListPostImages(ctx context.Context, postID string) ([]PostImag
&i.ObjectKey,
&i.PublicUrl,
&i.Description,
&i.Kind,
&i.Position,
&i.Width,
&i.Height,
@@ -327,7 +331,7 @@ WITH RECURSIVE thread AS (
)
SELECT
images.id, images.post_id, images.object_key, images.public_url,
images.description, images.position, images.width, images.height, images.created_at
images.description, images.kind, images.position, images.width, images.height, images.created_at
FROM post_images images
JOIN thread ON thread.id = images.post_id
ORDER BY images.post_id, images.position
@@ -348,6 +352,7 @@ func (q *Queries) ListPostThreadImages(ctx context.Context, rootID string) ([]Po
&i.ObjectKey,
&i.PublicUrl,
&i.Description,
&i.Kind,
&i.Position,
&i.Width,
&i.Height,