diff --git a/targets/hasura/migrations/default/1711447133683_add_lot_5/down.sql b/targets/hasura/migrations/default/1711447133683_add_lot_5/down.sql new file mode 100644 index 000000000..e69de29bb diff --git a/targets/hasura/migrations/default/1711447133683_add_lot_5/up.sql b/targets/hasura/migrations/default/1711447133683_add_lot_5/up.sql new file mode 100644 index 000000000..60fd401ff --- /dev/null +++ b/targets/hasura/migrations/default/1711447133683_add_lot_5/up.sql @@ -0,0 +1,8 @@ +update documents +set initial_id = a.id +from contribution.answers a + inner join contribution.questions q on q.id = a.question_id +where documents."source" = 'contributions' + and a.agreement_id = coalesce(documents."document"->'answers'->'conventionAnswer'->>'idcc', '0000') + and q."content" = documents."title" + and q.order in (11, 12, 14, 15, 16, 18, 38, 47, 48, 55);