Skip to content

Commit

Permalink
fix: migration script to update vm_observations_mailles
Browse files Browse the repository at this point in the history
  • Loading branch information
juggler31 committed Oct 14, 2024
1 parent 002c6ee commit c2c220e
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 @@ -27,7 +27,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 @@ -41,6 +42,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);

Expand Down

0 comments on commit c2c220e

Please sign in to comment.