helper script for transition to multiple variants

This commit is contained in:
Filip Graliński 2018-07-04 16:43:50 +02:00
parent 52ae6ae9a5
commit aa000b1a94

9
add-variants.sql Normal file
View File

@ -0,0 +1,9 @@
insert into variant(submission, name) select id, 'out' from submission;
update out
set variant=subquery.variant_id
from (select O.id as out_id, V.id as variant_id
from out as O, variant as V, submission as S
where V.submission = S.id and O.submission = S.id) AS subquery
where out.id = subquery.out_id;