From 75f92b09c6cf80845add06e18e451c750125a3ba Mon Sep 17 00:00:00 2001 From: jacquesfize Date: Thu, 18 Jul 2024 13:43:52 +0200 Subject: [PATCH] fix(occhab): rename view in migration + change "surface" --- .../migrations/295861464d84_change_export_view.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/contrib/gn_module_occhab/backend/gn_module_occhab/migrations/295861464d84_change_export_view.py b/contrib/gn_module_occhab/backend/gn_module_occhab/migrations/295861464d84_change_export_view.py index b8b8b213d2..3e3d454ad5 100644 --- a/contrib/gn_module_occhab/backend/gn_module_occhab/migrations/295861464d84_change_export_view.py +++ b/contrib/gn_module_occhab/backend/gn_module_occhab/migrations/295861464d84_change_export_view.py @@ -18,9 +18,10 @@ def upgrade(): + op.execute("DROP VIEW pr_occhab.v_export_sinp;") op.execute( """ - create or replace view pr_occhab.v_export_sinp_test as + create or replace view pr_occhab.v_export_sinp as select s.id_station, s.id_dataset, @@ -35,11 +36,11 @@ def upgrade(): ','::text), s.observers_txt::text) as "observateurs", nom2.cd_nomenclature as "methode_calcul_surface", - ST_Area(s.geom_4326) as "surface", + s.area as "surface", public.st_astext(s.geom_4326) as "geometry", public.st_asgeojson(s.geom_4326) as geojson, s.geom_local, - nom3.cd_nomenclature as "natureObjetGeo", + nom3.cd_nomenclature as "nature_objet_geo", h.unique_id_sinp_hab as "uuid_habitat", s.altitude_min as "altitude_min", s.altitude_max as "altitude_max", @@ -84,6 +85,7 @@ def upgrade(): def downgrade(): + op.execute("DROP VIEW pr_occhab.v_export_sinp;") op.execute( """ CREATE OR REPLACE view pr_occhab.v_export_sinp AS