Add support for icon collection importation.

This commit is contained in:
Andrey Antukh 2016-11-21 18:13:39 +01:00
parent 8ec32ad130
commit c0aa4a042f
No known key found for this signature in database
GPG key ID: 4DFEBCB8316A8B95
3 changed files with 33 additions and 31 deletions

View file

@ -22,6 +22,11 @@ values (:id, '00000000-0000-0000-0000-000000000000'::uuid, :name)
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 create-icons-collection
insert into icons_collections (id, "user", name)
values (:id, '00000000-0000-0000-0000-000000000000'::uuid, :name)
@ -29,11 +34,6 @@ values (:id, '00000000-0000-0000-0000-000000000000'::uuid, :name)
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
@ -41,12 +41,13 @@ select * from icons as i
-- :name create-icon :<! :1
insert into icons ("user", name, collection, metadata, content)
values (:user, :name, :collection, :metadata, :content)
values ('00000000-0000-0000-0000-000000000000'::uuid,
:name, :collection, :metadata, :content)
on conflict (id)
do update set name = :name,
content = :content,
metadata = :metadata,
collection = :collection
collection = :collection,
"user" = '00000000-0000-0000-0000-000000000000'::uuid
returning *;