Skip to content

Commit

Permalink
AOMs : pas d'espaces pour les départements (#3426)
Browse files Browse the repository at this point in the history
  • Loading branch information
AntoineAugusti authored Aug 28, 2023
1 parent 98ee562 commit 56662d9
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
8 changes: 4 additions & 4 deletions apps/transport/lib/transport/import_aom.ex
Original file line number Diff line number Diff line change
Expand Up @@ -58,15 +58,15 @@ defmodule Transport.ImportAOMs do
Ecto.Changeset.change(aom, %{
composition_res_id: external_id,
insee_commune_principale: insee,
departement: line["Dep"],
siren: line["N° SIREN"],
departement: line["Dep"] |> String.trim(),
siren: line["N° SIREN"] |> String.trim(),
nom: nom,
forme_juridique: normalize_forme(line["Forme juridique"]),
nombre_communes: to_int(line["Nombre de communes du RT"]),
population_municipale: to_int(line["Population municipale 2018"]),
population_totale: to_int(line["Population totale 2018"]),
surface: line["Surface (km²)"],
commentaire: line["Commentaire"],
surface: line["Surface (km²)"] |> String.trim(),
commentaire: line["Commentaire"] |> String.trim(),
region: new_region
})}
end
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
defmodule DB.Repo.Migrations.AomTrimDepartement do
use Ecto.Migration

def up do
execute "update aom set departement = trim(departement)"
end

def down do
IO.puts("No going back")
end
end

0 comments on commit 56662d9

Please sign in to comment.