Skip to content

Commit

Permalink
fix(occhab): rename view in migration + change "surface"
Browse files Browse the repository at this point in the history
  • Loading branch information
jacquesfize committed Jul 18, 2024
1 parent ba92ba7 commit 75f92b0
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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",
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 75f92b0

Please sign in to comment.