-- Rename the duplicate Edgar Degas category (id 1826) that was created by mistake.
-- Renaming it will make sure we do not get collision and undefined behavior on path lookups.

UPDATE categories
SET name = 'Edgar Degas (duplicate, to be deleted)'
WHERE id = 1826;

UPDATE categories_v2_lft_rgt
SET name = 'Edgar Degas (duplicate, to be deleted)'
WHERE id = 1826;

-- For cateogry_texts_v2 update wallpaper_name, canvas_name and name since all were set on category creation
UPDATE category_texts_v2
SET wallpaper_name = 'Edgar Degas (duplicate, to be deleted)',
    canvas_name = 'Edgar Degas (duplicate, to be deleted)',
    name = 'Edgar Degas (duplicate, to be deleted)'
WHERE category_id = 1826;

REFRESH MATERIALIZED VIEW mv_category_locale_safexmlpath_v2;
REFRESH MATERIALIZED VIEW v_categorytree_v2;
REFRESH MATERIALIZED VIEW v_esales_categorytree_i18n_v2;
