Files
database/migrations/archive/000.045.sql
T
Rikard BartholfandGitHub ddcbd0afb0 Archive old migrations (#426)
* Archive old migrations

* Fix invalid placement of migrations
2024-10-17 11:19:12 +02:00

25 lines
877 B
SQL

--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
;