Skip to content

Commit

Permalink
fix: migration script to update vm_observations_mailles (#581)
Browse files Browse the repository at this point in the history
  • Loading branch information
juggler31 authored Oct 16, 2024
1 parent 86ffe9c commit 2134315
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion data/update/update_1.6.1to1.6.2.sql
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ CREATE MATERIALIZED VIEW atlas.vm_observations_mailles AS
o.cd_ref,
date_part('year', o.dateobs) AS annee,
m.id_maille,
COUNT(o.id_observation) AS nbr
COUNT(o.id_observation) AS nbr,
ARRAY_AGG(o.id_observation) AS id_observations
FROM atlas.vm_observations AS o
JOIN atlas.t_mailles_territoire AS m
ON (o.the_geom_point && m.the_geom)
Expand All @@ -24,6 +25,9 @@ CREATE UNIQUE INDEX ON atlas.vm_observations_mailles
CREATE INDEX ON atlas.vm_observations_mailles
USING btree (annee);

CREATE INDEX ON atlas.vm_observations_mailles
USING gin (id_observations);

CREATE INDEX ON atlas.vm_observations_mailles
USING btree (id_maille, cd_ref);

0 comments on commit 2134315

Please sign in to comment.