P5-1636: Migrate old designer descriptions to the new solution for photowall 5
This commit is contained in:
@@ -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
|
||||
;
|
||||
Reference in New Issue
Block a user