Small typos in import.sql

This commit is contained in:
2025-08-29 13:01:54 +02:00
parent 6b8ca0caa3
commit 5bfc7f4a02
10 changed files with 10 additions and 10 deletions

0
.gitignore vendored Normal file → Executable file
View File

0
README.md Normal file → Executable file
View File

0
canvas/chill_canevas_reprise-de-données.xlsx Normal file → Executable file
View File

0
csv/choix_periodes.dist.csv Normal file → Executable file
View File

0
csv/choix_personnes.dist.csv Normal file → Executable file
View File

0
csv/periodes.dist.csv Normal file → Executable file
View File

0
csv/personnes.dist.csv Normal file → Executable file
View File

View File

@@ -499,7 +499,7 @@ UPDATE import.localisations AS loc SET address_ref_id = cmar.id FROM chill_main_
WHERE
cmar.postcode_id = ANY(loc.postcode_arr)
AND similarity(trim(loc.street), trim(cmar.street)) > 0.6
AND trim(loc.streetnumber) = trim(cmar.streetnumber)
AND trim(loc.streetnumber) = trim(cmar.streetnumber);
--SELECT * FROM import.localisations as l
--WHERE l.address_ref_id IS NULL
@@ -600,7 +600,7 @@ INSERT INTO public.users
(id, username, "password", enabled, "locked", usernamecanonical, email, emailcanonical, "label", civility_id, phonenumber)
SELECT nextval('users_id_seq'),
SPLIT_PART(t."email",'@',1),
'', --TODO PW
'',
TRUE,
TRUE,
t."login",
@@ -631,9 +631,9 @@ WHERE NOT EXISTS ( SELECT 1 FROM chill_main_user_job_history WHERE user_id = (SE
-- 69. Complete table party_category
WITH categories AS (SELECT DISTINCT(trim(t.categorie)) AS title
FROM IMPORT.tiers AS t)
FROM IMPORT.tiers AS t)
INSERT INTO chill_3party.party_category (id, "name", active)
SELECT
SELECT
nextval('chill_3party.party_category_id_seq'),
jsonb_build_object('fr', c.title),
TRUE
@@ -659,7 +659,7 @@ SET postcode_arr = (
UPDATE import.tiers AS tiers SET address_ref_id = cmar.id FROM chill_main_address_reference AS cmar
WHERE
cmar.postcode_id = ANY(tiers.postcode_arr)
AND similarity(trim(tiers.adresse), trim(cmar.street)) > 0.6
AND similarity(trim(tiers.adresse), trim(cmar.street)) > 0.6;
--SELECT * FROM import.tiers as l
--WHERE l.address_ref_id IS NULL
@@ -711,7 +711,7 @@ END $$;
-- Insert companies (parent) first
INSERT INTO chill_3party.third_party
INSERT INTO chill_3party.third_party
(id, "name", telephone, email, "comment", "types", active, address_id, parent_id, updated_by, name_company, acronym, created_at, updated_at, created_by, civility_id, kind, canonicalized, contact_data_anonymous, firstname, profession, telephone2)
SELECT nextval('chill_3party.third_party_id_seq'),
trim(nom),
@@ -719,7 +719,7 @@ INSERT INTO chill_3party.third_party
t.email,
concat('horaires: ', t.horaires, ' \n \n observations: ', t.observations),
NULL,
TRUE,
TRUE,
t.address_id,
NULL, -- parent
(SELECT distinct(first_value(id) OVER(ORDER BY id)) FROM users),
@@ -748,10 +748,10 @@ SELECT DISTINCT
FROM import.tiers AS t LEFT JOIN chill_3party.third_party AS tp ON trim(t.nom) = tp."name"
WHERE tp.id IS NOT NULL;
-- Insert contact (child) second
INSERT INTO chill_3party.third_party
-- Insert contact (child) second
INSERT INTO chill_3party.third_party
(id, "name", telephone, email, "comment", "types", active, address_id, parent_id, updated_by, name_company, acronym, created_at, updated_at, created_by, civility_id, kind, canonicalized, contact_data_anonymous, firstname, profession, telephone2)
SELECT
SELECT
nextval('chill_3party.third_party_id_seq'),
trim(t.personne_nom),
NULL, -- telephone

0
third_party/README.md vendored Normal file → Executable file
View File

0
third_party/import_third_party_to_sql.py vendored Normal file → Executable file
View File