* delete producttitles and report back * move file to correct migration number
17 lines
476 B
SQL
17 lines
476 B
SQL
WITH deleted_textids AS (
|
|
SELECT textid FROM "i18n-texts" WHERE category = 'productTitles'
|
|
),
|
|
deleted_data AS (
|
|
DELETE FROM "i18n-texts_data"
|
|
WHERE textid IN (SELECT textid FROM deleted_textids)
|
|
RETURNING textid
|
|
),
|
|
deleted_texts AS (
|
|
DELETE FROM "i18n-texts"
|
|
WHERE textid IN (SELECT textid FROM deleted_textids)
|
|
RETURNING textid
|
|
)
|
|
SELECT
|
|
(SELECT COUNT(*) FROM deleted_data) AS deleted_data_count,
|
|
(SELECT COUNT(*) FROM deleted_texts) AS deleted_texts_count;
|