Skip to content

Commit

Permalink
only add not null substrat
Browse files Browse the repository at this point in the history
  • Loading branch information
nicokant committed Oct 24, 2023
1 parent 5266b20 commit 6cdb107
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions db/migrations/20231020130627_import_procedure.sql
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,13 @@ declare
begin
select id into stasjon_id from stasjoner as st where st.vassdrag = data->>'Vassdragsnummer' and st.loknr = data->>'Loknr';

substrater := substrater || lower(data->>'Substrat_1')::substrat;
substrater := substrater || lower(data->>'Substrat_2')::substrat;
if data->>'Substrat_1' then
substrater := substrater || lower(data->>'Substrat_1')::substrat;
end if;

if data->>'Substrat_2' then
substrater := substrater || lower(data->>'Substrat_2')::substrat;
end if;

insert into kantvegetasjon values (lower(data->>'Kantvegetasjon')) on conflict do nothing;

Expand Down

0 comments on commit 6cdb107

Please sign in to comment.