Skip to content

Commit

Permalink
fix #453 - load stream habitat view before using it
Browse files Browse the repository at this point in the history
  • Loading branch information
smnorris committed Feb 9, 2024
1 parent 0ab30b7 commit 406517b
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions model/02_habitat_linear/habitat_linear.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ done
# (this is highly likely to be present elsewhere but has not been investigated)
$PSQL -f sql/horsefly_sk.sql

# with linear model processing complete, refresh streams materialized views
$PSQL -c "refresh materialized view bcfishpass.streams_habitat_known_vw"
$PSQL -c "refresh materialized view bcfishpass.streams_habitat_linear_vw"
$PSQL -c "refresh materialized view bcfishpass.streams_mapping_code_vw"

# generate report of habitat length upstream of all crossings
$PSQL -c "truncate bcfishpass.crossings_upstream_habitat"
# load data in parallel
Expand All @@ -28,11 +33,7 @@ do
$PSQL -f sql/load_crossings_upstream_habitat_02.sql -v wsg=$wsg
done

# with linear model processing complete, refresh materialized views
$PSQL -c "refresh materialized view bcfishpass.streams_habitat_known_vw"
$PSQL -c "refresh materialized view bcfishpass.streams_habitat_linear_vw"
$PSQL -c "refresh materialized view bcfishpass.streams_mapping_code_vw"

# refresh crossings views
$PSQL -c "refresh materialized view bcfishpass.crossings_upstr_barriers_per_model_vw"
$PSQL -c "refresh materialized view bcfishpass.crossings_upstr_observations_vw"
$PSQL -c "refresh materialized view bcfishpass.crossings_dnstr_observations_vw"
Expand Down

0 comments on commit 406517b

Please sign in to comment.