diff --git a/db/v0.5.3/migrate.sh b/db/v0.5.3/migrate.sh old mode 100644 new mode 100755 index a1c92b8f..25d93de0 --- a/db/v0.5.3/migrate.sh +++ b/db/v0.5.3/migrate.sh @@ -1,8 +1,12 @@ #!/bin/bash set -euxo pipefail +# add wcrp name column to wcrp table +psql $DATABASE_URL -v ON_ERROR_STOP=1 -c "alter table bcfishpass.wcrp_watersheds add column wcrp varchar(32);" + +# add wcrp tracking views echo "On systems supporting CWF WCRP reporting, add join_tracking_table_crossings_view.sql" -echo "psql $DATABASE_URL -f sql/join_tracking_table_crossings_view.sql" +echo "psql $DATABASE_URL -v ON_ERROR_STOP=1 -f sql/join_tracking_table_crossings_view.sql" # note version -psql $DATABASE_URL -c "update bcfishpass.db_version set tag = '${PWD##*/}'" \ No newline at end of file +psql $DATABASE_URL -v ON_ERROR_STOP=1 -c "update bcfishpass.db_version set tag = '${PWD##*/}'" \ No newline at end of file diff --git a/db/v0.5.3/sql/join_tracking_table_crossings_vw.sql b/db/v0.5.3/sql/join_tracking_table_crossings_vw.sql index c753e923..f5ed09ef 100644 --- a/db/v0.5.3/sql/join_tracking_table_crossings_vw.sql +++ b/db/v0.5.3/sql/join_tracking_table_crossings_vw.sql @@ -1,7 +1,3 @@ --- Add the wcrp column to the wcrp_watersheds table -alter table bcfishpass.wcrp_watersheds -add column wcrp varchar(32); - -- This function joins the tracking table to bcfishpass.crossings_wcrp_vw on the barrier ID create or replace function wcrp_hors.join_tracking_table_crossings_wcrp_vw(p_wcrp text) returns void