Skip to content

Commit 617c42d

Browse files
author
github-actions
committed
Automated dump generation
1 parent b242f2b commit 617c42d

2 files changed

Lines changed: 6 additions & 4 deletions

File tree

docs/data_model/gn_synthese/synthese.sql

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,8 @@ CREATE TRIGGER tri_update_calculate_sensitivity BEFORE UPDATE OF date_min, date_
200200

201201
CREATE TRIGGER tri_update_cor_area_synthese AFTER UPDATE OF the_geom_local, the_geom_4326 ON gn_synthese.synthese FOR EACH ROW EXECUTE FUNCTION gn_synthese.fct_trig_update_in_cor_area_synthese();
202202

203+
ALTER TABLE ONLY gn_synthese.synthese
204+
203205
ALTER TABLE ONLY gn_synthese.synthese
204206
ADD CONSTRAINT fk_synthese_cd_hab FOREIGN KEY (cd_hab) REFERENCES ref_habitats.habref(cd_hab) ON UPDATE CASCADE;
205207

docs/data_model/taxonomie/functions.sql

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ AS $function$
7676
END;
7777
$function$
7878

79-
CREATE OR REPLACE FUNCTION taxonomie.find_all_taxons_children(ids integer[])
79+
CREATE OR REPLACE FUNCTION taxonomie.find_all_taxons_children(id integer)
8080
RETURNS TABLE(cd_nom integer, cd_ref integer)
8181
LANGUAGE plpgsql
8282
IMMUTABLE
@@ -88,7 +88,7 @@ AS $function$
8888
BEGIN
8989
RETURN QUERY
9090
WITH RECURSIVE descendants AS (
91-
SELECT tx1.cd_nom, tx1.cd_ref FROM taxonomie.taxref tx1 WHERE tx1.cd_sup = ANY(ids)
91+
SELECT tx1.cd_nom, tx1.cd_ref FROM taxonomie.taxref tx1 WHERE tx1.cd_sup = id
9292
UNION ALL
9393
SELECT tx2.cd_nom, tx2.cd_ref FROM descendants d JOIN taxonomie.taxref tx2 ON tx2.cd_sup = d.cd_nom
9494
)
@@ -97,7 +97,7 @@ AS $function$
9797
END;
9898
$function$
9999

100-
CREATE OR REPLACE FUNCTION taxonomie.find_all_taxons_children(id integer)
100+
CREATE OR REPLACE FUNCTION taxonomie.find_all_taxons_children(ids integer[])
101101
RETURNS TABLE(cd_nom integer, cd_ref integer)
102102
LANGUAGE plpgsql
103103
IMMUTABLE
@@ -109,7 +109,7 @@ AS $function$
109109
BEGIN
110110
RETURN QUERY
111111
WITH RECURSIVE descendants AS (
112-
SELECT tx1.cd_nom, tx1.cd_ref FROM taxonomie.taxref tx1 WHERE tx1.cd_sup = id
112+
SELECT tx1.cd_nom, tx1.cd_ref FROM taxonomie.taxref tx1 WHERE tx1.cd_sup = ANY(ids)
113113
UNION ALL
114114
SELECT tx2.cd_nom, tx2.cd_ref FROM descendants d JOIN taxonomie.taxref tx2 ON tx2.cd_sup = d.cd_nom
115115
)

0 commit comments

Comments
 (0)