commit 9834a1ade765ca554e3f284f032e29a3357de37c Author: LenaertsJ Date: Mon Feb 24 12:26:48 2025 +0000 Add Home diff --git a/Home.md b/Home.md new file mode 100644 index 0000000..6b142b5 --- /dev/null +++ b/Home.md @@ -0,0 +1,29 @@ +### Import social issues + +``` +INSERT INTO chill_person_social_issue (id, parent_id, title, ordering) +SELECT nextval('chill_person_social_issue_id_seq'), id, jsonb_build_object('fr', sub.content), i.ordering + sub.ordering::double precision +FROM chill_person_social_issue i +CROSS JOIN (VALUES + ('Informer, conseiller', 0.005), + ('Réorienter', 0.015), + ('Démarches administratives', 0.055) ) +AS sub(content, ordering); +``` + +### Import social actions + +``` +-- ajoute les trois actions "Informer, conseiller", "Réorienter" et "Démarche administrative" +-- à toutes les problématiques "enfants" (qui ont un parent) (/!\ ne fonctionne que s'il y a deux niveaux de problématique: parent et enfant, et donc pas de petits-enfants) + +INSERT INTO chill_person_social_action (id, issue_id, title, ordering) +SELECT nextval('chill_person_social_action_id_seq'), id, jsonb_build_object('fr', sub.content), i.ordering + sub.ordering::double precision +FROM chill_person_social_issue i +CROSS JOIN (VALUES + ('Informer, conseiller', 0.005), + ('Réorienter', 0.015), + ('Démarches administratives', 0.025) ) +AS sub(content, ordering) +WHERE i.parent_id IS NOT NULL; +``` \ No newline at end of file