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:
parent
ac14c549ef
commit
77bdd47c86
1 changed files with 4 additions and 2 deletions
|
@ -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;
|
||||||
|
|
Loading…
Add table
Reference in a new issue