diff --git a/migrations/000.045.sql b/migrations/000.045.sql new file mode 100644 index 0000000..6982533 --- /dev/null +++ b/migrations/000.045.sql @@ -0,0 +1,25 @@ +--P5-1636 +INSERT INTO designer_texts (designerid, locale_id, header, description) ( + SELECT + d.designerid, + l.id AS locale_id, + td_head.text AS header, + td_descr.text AS description + FROM + locales AS l + CROSS JOIN designers AS d + + LEFT JOIN "i18n-texts" AS t_head ON t_head.name = d.path AND t_head.category = 'categoryH1_photo-wallpaper' + INNER JOIN "i18n-texts_data" AS td_head + ON t_head.textid = td_head.textid AND l.value = td_head.language || '_' || td_head.territory + + LEFT JOIN "i18n-texts" AS t_descr + ON t_descr.name = d.path AND t_descr.category = 'categoryDescription_photo-wallpaper' + INNER JOIN "i18n-texts_data" AS td_descr + ON t_descr.textid = td_descr.textid AND l.value = td_descr.language || '_' || td_descr.territory + + WHERE + td_head.text IS NOT NULL OR td_descr.text IS NOT NULL +) +ON CONFLICT DO NOTHING +; \ No newline at end of file