Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add missing GRANT into update_1.5.2to1.6.0.sql #567

Merged
merged 1 commit into from
Oct 15, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions data/update/update_1.5.2to1.6.0.sql
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ WHERE NOT t_medias.supprime = true;

CREATE UNIQUE INDEX ON atlas.vm_medias (id_media);


CREATE MATERIALIZED VIEW atlas.vm_taxons_plus_observes AS
SELECT count(*) AS nb_obs,
obs.cd_ref,
Expand All @@ -42,8 +41,8 @@ WITH DATA;
-- View indexes:
CREATE UNIQUE INDEX vm_taxons_plus_observes_cd_ref_idx ON atlas.vm_taxons_plus_observes USING btree (cd_ref);


---------------------------

DROP MATERIALIZED VIEW atlas.vm_cor_taxon_organism;

CREATE MATERIALIZED VIEW atlas.vm_cor_taxon_organism AS
Expand Down Expand Up @@ -79,11 +78,13 @@ CREATE UNIQUE INDEX vm_cor_taxon_organism_cd_ref_id_organism_idx
CREATE INDEX vm_cor_taxon_organism_id_organism_idx
ON atlas.vm_cor_taxon_organism USING btree (id_organism);


DROP VIEW utilisateurs.reduced_cor_dataset_actor;



-- Donner les droits de lecture sur les VUES recréées précedemment à l'utilisateur de BDD utilisé par l'application
-- geonatatlas à modifier par votre utilisateur de BDD si vous avez défini un autre nom d'utilisateur pour cet utilisateur
GRANT SELECT ON TABLE atlas.vm_taxons_plus_observes TO geonatatlas;
GRANT SELECT ON TABLE atlas.vm_medias TO geonatatlas;
GRANT SELECT ON TABLE atlas.vm_cor_taxon_organism TO geonatatlas;

-- Rafraichissement des vues contenant les données de l'atlas
CREATE OR REPLACE FUNCTION atlas.refresh_materialized_view_data()
Expand All @@ -94,9 +95,7 @@ BEGIN
REFRESH MATERIALIZED VIEW CONCURRENTLY atlas.vm_observations_mailles;
REFRESH MATERIALIZED VIEW CONCURRENTLY atlas.vm_cor_taxon_organism;
REFRESH MATERIALIZED VIEW CONCURRENTLY atlas.vm_mois;

REFRESH MATERIALIZED VIEW CONCURRENTLY atlas.vm_altitudes;

REFRESH MATERIALIZED VIEW CONCURRENTLY atlas.vm_taxons;
REFRESH MATERIALIZED VIEW CONCURRENTLY atlas.vm_cor_taxon_attribut;
REFRESH MATERIALIZED VIEW CONCURRENTLY atlas.vm_search_taxon;
Expand Down
Loading