0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-02-13 02:28:18 -05:00

Fix images sql functions for properly return builtin collections.

This commit is contained in:
Andrey Antukh 2016-11-22 17:09:55 +01:00
parent ac14c549ef
commit 77bdd47c86
No known key found for this signature in database
GPG key ID: 4DFEBCB8316A8B95

View file

@ -15,7 +15,8 @@ returning *;
select *, select *,
(select count(*) from images where collection = ic.id) as num_images (select count(*) from images where collection = ic.id) as num_images
from images_collections as ic from images_collections as ic
where ic."user" = :user where (ic."user" = :user or
uc."user" = '00000000-0000-0000-0000-000000000000'::uuid)
and ic.deleted_at is null and ic.deleted_at is null
order by ic.created_at desc; order by ic.created_at desc;
@ -27,7 +28,8 @@ update images_collections
-- :name get-images-by-collection :? :* -- :name get-images-by-collection :? :*
select * from images select * from images
where "user" = :user where ("user" = :user or
"user" = '00000000-0000-0000-0000-000000000000'::uuid)
and deleted_at is null and deleted_at is null
and collection = :collection and collection = :collection
order by created_at desc; order by created_at desc;