post_images.kind is image or video. A post can keep one video alongside up to four images. Reviewed-on: #21 Co-authored-by: codegirl-007 <s.raide@gmail.com>
This commit was merged in pull request #21.
This commit is contained in:
@@ -63,7 +63,7 @@ WHERE id = sqlc.arg(id);
|
||||
|
||||
-- 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 (
|
||||
sqlc.arg(id),
|
||||
@@ -71,6 +71,7 @@ VALUES (
|
||||
sqlc.arg(object_key),
|
||||
sqlc.arg(public_url),
|
||||
sqlc.arg(description),
|
||||
sqlc.arg(kind),
|
||||
sqlc.arg(position),
|
||||
sqlc.arg(width),
|
||||
sqlc.arg(height),
|
||||
@@ -83,7 +84,7 @@ WHERE post_id = sqlc.arg(post_id);
|
||||
|
||||
-- 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 = sqlc.arg(post_id)
|
||||
ORDER BY position;
|
||||
@@ -102,7 +103,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;
|
||||
|
||||
Reference in New Issue
Block a user