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

Branche 'next' : quelques potentielles coquilles dans les scripts SQL #3

Open
eguilley opened this issue Jun 11, 2021 · 1 comment
Open

Comments

@eguilley
Copy link

👉 En utilisant les scripts SQL de la branche next pour la BDD GeoNature Pays de la Loire, j'ai repéré ce qui me semble être quelques coquilles (ou peut-être pas 🤷‍♀️) :

00_init_db.sql

Manque le nom du schéma src_lpodatas :

CREATE SCHEMA IF NOT EXISTS AUTHORIZATION geonatadmin;

07_update_synthese_extended.sql

Il y a un gnadm qui traîne alors que partout ailleurs c'est geonatadmin :

ALTER FUNCTION src_lpodatas.fct_tri_c_delete_vn_observation_from_geonature () OWNER TO gnadm
;

08a_init_data_nomenclatures.sql

J'ai l'impression que ce bloc est un test ? Je me demandais s'il n'était pas nécessaire de le commenter :

WITH selection AS (
SELECT
site,
id
FROM
src_vn_json.observations_json
LIMIT 5)
UPDATE
src_vn_json.observations_json
SET
site = observations_json.site
FROM
selection
WHERE
observations_json.site = selection.site
AND observations_json.id = selection.id

@eguilley
Copy link
Author

eguilley commented Sep 6, 2021

07_update_synthese_extended.sql

D'après les conventions de nommage, le trigger devrait s'appeler tri_c_upsert_vn_observation_to_geonature et non fct_tri_c_upsert_vn_observation_to_geonature :

DROP TRIGGER IF EXISTS fct_tri_c_upsert_vn_observation_to_geonature ON src_vn_json.observations_json
;
CREATE TRIGGER fct_tri_c_upsert_vn_observation_to_geonature
AFTER INSERT OR UPDATE
ON src_vn_json.observations_json
FOR EACH ROW
EXECUTE PROCEDURE src_lpodatas.fct_tri_c_upsert_vn_observation_to_geonature ()
;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant