mirror of
https://github.com/penpot/penpot.git
synced 2025-05-10 03:56:37 +02:00
Add partial impl for icons collections importer (wip).
This commit is contained in:
parent
6d0737e4a3
commit
cf1188ad47
2 changed files with 87 additions and 5 deletions
|
@ -15,14 +15,38 @@ delete from images
|
|||
where id = :id
|
||||
and "user" = '00000000-0000-0000-0000-000000000000'::uuid;
|
||||
|
||||
-- :name create-image-collection
|
||||
-- :name create-images-collection
|
||||
insert into images_collections (id, "user", name)
|
||||
values (:id, '00000000-0000-0000-0000-000000000000'::uuid, :name)
|
||||
on conflict (id)
|
||||
do update set name = :name
|
||||
returning *;
|
||||
|
||||
-- :name create-icons-collection
|
||||
insert into icons_collections (id, "user", name)
|
||||
values (:id, '00000000-0000-0000-0000-000000000000'::uuid, :name)
|
||||
on conflict (id)
|
||||
do update set name = :name
|
||||
returning *;
|
||||
|
||||
-- :name get-image
|
||||
select * from images as i
|
||||
where i.id = :id
|
||||
and i."user" = '00000000-0000-0000-0000-000000000000'::uuid;
|
||||
|
||||
-- :name get-icon
|
||||
select * from icons as i
|
||||
where i.id = :id
|
||||
and i."user" = '00000000-0000-0000-0000-000000000000'::uuid;
|
||||
|
||||
-- :name create-icon :<! :1
|
||||
insert into icons ("user", name, collection, metadata, content)
|
||||
values (:user, :name, :collection, :metadata, :content)
|
||||
on conflict (id)
|
||||
do update set name = :name,
|
||||
content = :content,
|
||||
metadata = :metadata,
|
||||
collection = :collection
|
||||
"user" = '00000000-0000-0000-0000-000000000000'::uuid
|
||||
returning *;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue