-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of github.com:smnorris/bcfishpass
* 'main' of github.com:smnorris/bcfishpass: Log model runs and results summaries (#439)
- Loading branch information
Showing
4 changed files
with
268 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,133 @@ | ||
--do not generally drop or truncate this table - we want to retain this data | ||
--drop table bcfishpass.log cascade; | ||
--truncate bcfishpass.log cascade; | ||
create table if not exists bcfishpass.log ( | ||
model_run_id serial primary key, | ||
model_type text not null, | ||
date_completed timestamp not null default CURRENT_TIMESTAMP, | ||
git_id bytea not null, | ||
check (model_type in ('LINEAR','LATERAL')) | ||
); | ||
|
||
-- usage: | ||
-- insert into bcfishpass.log (model_type, git_id) values ('LINEAR', decode('feac3689cef93cc02a4cb4ac6a0fdadebe980f4d', 'hex')) RETURNING model_run_id; | ||
|
||
create table if not exists bcfishpass.wsg_linear_summary ( | ||
model_run_id integer references bcfishpass.log(model_run_id), | ||
watershed_group_code text, | ||
length_total numeric, | ||
length_potentiallyaccessible_bt numeric, | ||
length_potentiallyaccessible_bt_observed numeric, | ||
length_potentiallyaccessible_bt_accessible_a numeric, | ||
length_potentiallyaccessible_bt_accessible_b numeric, | ||
length_obsrvd_spawning_rearing_bt numeric, | ||
length_obsrvd_spawning_rearing_bt_accessible_a numeric, | ||
length_obsrvd_spawning_rearing_bt_accessible_b numeric, | ||
length_spawning_rearing_bt numeric, | ||
length_spawning_rearing_bt_accessible_a numeric, | ||
length_spawning_rearing_bt_accessible_b numeric, | ||
length_potentiallyaccessible_ch_cm_co_pk_sk numeric, | ||
length_potentiallyaccessible_ch_cm_co_pk_sk_observed numeric, | ||
length_potentiallyaccessible_ch_cm_co_pk_sk_accessible_a numeric, | ||
length_potentiallyaccessible_ch_cm_co_pk_sk_accessible_b numeric, | ||
length_obsrvd_spawning_rearing_ch numeric, | ||
length_obsrvd_spawning_rearing_ch_accessible_a numeric, | ||
length_obsrvd_spawning_rearing_ch_accessible_b numeric, | ||
length_spawning_rearing_ch numeric, | ||
length_spawning_rearing_ch_accessible_a numeric, | ||
length_spawning_rearing_ch_accessible_b numeric, | ||
length_obsrvd_spawning_rearing_cm numeric, | ||
length_obsrvd_spawning_rearing_cm_accessible_a numeric, | ||
length_obsrvd_spawning_rearing_cm_accessible_b numeric, | ||
length_spawning_rearing_cm numeric, | ||
length_spawning_rearing_cm_accessible_a numeric, | ||
length_spawning_rearing_cm_accessible_b numeric, | ||
length_obsrvd_spawning_rearing_co numeric, | ||
length_obsrvd_spawning_rearing_co_accessible_a numeric, | ||
length_obsrvd_spawning_rearing_co_accessible_b numeric, | ||
length_spawning_rearing_co numeric, | ||
length_spawning_rearing_co_accessible_a numeric, | ||
length_spawning_rearing_co_accessible_b numeric, | ||
length_obsrvd_spawning_rearing_pk numeric, | ||
length_obsrvd_spawning_rearing_pk_accessible_a numeric, | ||
length_obsrvd_spawning_rearing_pk_accessible_b numeric, | ||
length_spawning_rearing_pk numeric, | ||
length_spawning_rearing_pk_accessible_a numeric, | ||
length_spawning_rearing_pk_accessible_b numeric, | ||
length_obsrvd_spawning_rearing_sk numeric, | ||
length_obsrvd_spawning_rearing_sk_accessible_a numeric, | ||
length_obsrvd_spawning_rearing_sk_accessible_b numeric, | ||
length_spawning_rearing_sk numeric, | ||
length_spawning_rearing_sk_accessible_a numeric, | ||
length_spawning_rearing_sk_accessible_b numeric, | ||
length_potentiallyaccessible_st numeric, | ||
length_potentiallyaccessible_st_observed numeric, | ||
length_potentiallyaccessible_st_accessible_a numeric, | ||
length_potentiallyaccessible_st_accessible_b numeric, | ||
length_obsrvd_spawning_rearing_st numeric, | ||
length_obsrvd_spawning_rearing_st_accessible_a numeric, | ||
length_obsrvd_spawning_rearing_st_accessible_b numeric, | ||
length_spawning_rearing_st numeric, | ||
length_spawning_rearing_st_accessible_a numeric, | ||
length_spawning_rearing_st_accessible_b numeric, | ||
length_potentiallyaccessible_wct numeric, | ||
length_potentiallyaccessible_wct_observed numeric, | ||
length_potentiallyaccessible_wct_accessible_a numeric, | ||
length_potentiallyaccessible_wct_accessible_b numeric, | ||
length_obsrvd_spawning_rearing_wct numeric, | ||
length_obsrvd_spawning_rearing_wct_accessible_a numeric, | ||
length_obsrvd_spawning_rearing_wct_accessible_b numeric, | ||
length_spawning_rearing_wct numeric, | ||
length_spawning_rearing_wct_accessible_a numeric, | ||
length_spawning_rearing_wct_accessible_b numeric | ||
); | ||
|
||
create table if not exists bcfishpass.wsg_crossing_summary ( | ||
model_run_id integer references bcfishpass.log(model_run_id), | ||
watershed_group_code text, | ||
crossing_feature_type text, | ||
n_crossings_total integer, | ||
n_passable_total integer, | ||
n_barriers_total integer, | ||
n_potential_total integer, | ||
n_unknown_total integer, | ||
n_barriers_accessible_bt integer, | ||
n_potential_accessible_bt integer, | ||
n_unknown_accessible_bt integer, | ||
n_barriers_accessible_ch_cm_co_pk_sk integer, | ||
n_potential_accessible_ch_cm_co_pk_sk integer, | ||
n_unknown_accessible_ch_cm_co_pk_sk integer, | ||
n_barriers_accessible_st integer, | ||
n_potential_accessible_st integer, | ||
n_unknown_accessible_st integer, | ||
n_barriers_accessible_wct integer, | ||
n_potential_accessible_wct integer, | ||
n_unknown_accessible_wct integer, | ||
n_barriers_habitat_bt integer, | ||
n_potential_habitat_bt integer, | ||
n_unknown_habitat_bt integer, | ||
n_barriers_habitat_ch integer, | ||
n_potential_habitat_ch integer, | ||
n_unknown_habitat_ch integer, | ||
n_barriers_habitat_cm integer, | ||
n_potential_habitat_cm integer, | ||
n_unknown_habitat_cm integer, | ||
n_barriers_habitat_co integer, | ||
n_potential_habitat_co integer, | ||
n_unknown_habitat_co integer, | ||
n_barriers_habitat_pk integer, | ||
n_potential_habitat_pk integer, | ||
n_unknown_habitat_pk integer, | ||
n_barriers_habitat_sk integer, | ||
n_potential_habitat_sk integer, | ||
n_unknown_habitat_sk integer, | ||
n_barriers_habitat_salmon integer, | ||
n_potential_habitat_salmon integer, | ||
n_unknown_habitat_salmon integer, | ||
n_barriers_habitat_st integer, | ||
n_potential_habitat_st integer, | ||
n_unknown_habitat_st integer, | ||
n_barriers_habitat_wct integer, | ||
n_potential_habitat_wct integer, | ||
n_unknown_habitat_wct integer | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters