Add SQL script to rebuild categories hierarchy.

This commit is contained in:
Florian THIERRY
2024-04-22 16:05:59 +02:00
parent 4985889c58
commit d324b94ddb

View File

@@ -10,3 +10,27 @@ insert into user_role values
insert into category values insert into category values
('172fa901-3f4b-4540-92f3-1c15820e8ec9', 'Main category', null), ('172fa901-3f4b-4540-92f3-1c15820e8ec9', 'Main category', null),
('3f4b4540-a901-92f3-1c15-8ec9172f820e', 'Sub category', '172fa901-3f4b-4540-92f3-1c15820e8ec9'); ('3f4b4540-a901-92f3-1c15-8ec9172f820e', 'Sub category', '172fa901-3f4b-4540-92f3-1c15820e8ec9');
UPDATE public.category
SET parent_category_id='04347de5-2814-4aff-9fe9-51b34c1c743e'
WHERE id in (
'0f4c4d7c-2ccc-4725-88b6-672aa518da90',
'2cad9c28-ab5d-4c8f-b7da-70ff8bc02586'
);
UPDATE public.category
SET parent_category_id='3dec7c5a-e7d6-4b21-beb1-209cdf5be067'
WHERE id in (
'61f9fbf3-3340-4ea4-9661-04089377bb2e',
'753570cc-3403-4bac-b9da-6c19875d98b7',
'1515ff79-e42e-4d84-9496-6cdcf1cb74f2',
'b58bda0b-2f45-4c7a-8ece-1a206fb32a7a',
'49b4df8a-19f5-459b-b508-6b7c71332523'
);
UPDATE public.category
SET parent_category_id='41b2792e-6f65-48be-8718-82ac58101aa8'
WHERE id in (
'7234cd9e-3834-45c5-973b-1574f5c3c4c6',
'f46fb104-4f53-4732-b33b-6a3ef8c2c0a3'
);