From 884e3e30a845036d4a4646422d570f30738771b3 Mon Sep 17 00:00:00 2001 From: Simon Norris Date: Fri, 5 Jan 2024 15:19:47 -0800 Subject: [PATCH] add missing precip table and use prod wsg in access --- db/tables/mean_annual_precip.sql | 14 ++++++++++++++ model/01_access/Makefile | 4 ++-- 2 files changed, 16 insertions(+), 2 deletions(-) create mode 100644 db/tables/mean_annual_precip.sql diff --git a/db/tables/mean_annual_precip.sql b/db/tables/mean_annual_precip.sql new file mode 100644 index 00000000..87c08c04 --- /dev/null +++ b/db/tables/mean_annual_precip.sql @@ -0,0 +1,14 @@ +drop table bcfishpass.mean_annual_precip; +create table bcfishpass.mean_annual_precip ( + id integer primary key, + wscode_ltree ltree , + localcode_ltree ltree , + watershed_group_code text , + area bigint , + map integer, + map_upstream integer +); +create index on bcfishpass.mean_annual_precip using gist (localcode_ltree); +create index on bcfishpass.mean_annual_precip using btree (localcode_ltree); +create index on bcfishpass.mean_annual_precip using gist (wscode_ltree); +create index on bcfishpass.mean_annual_precip using btree (wscode_ltree); diff --git a/model/01_access/Makefile b/model/01_access/Makefile index 6dd91bc3..308d14c3 100644 --- a/model/01_access/Makefile +++ b/model/01_access/Makefile @@ -4,9 +4,9 @@ PSQL=psql $(DATABASE_URL) -v ON_ERROR_STOP=1 # point psql to db and stop on errors # process all watershed groups -#WSGS = $(shell $(PSQL) -AtX -c "SELECT watershed_group_code FROM whse_basemapping.fwa_watershed_groups_poly") +WSGS = $(shell $(PSQL) -AtX -c "SELECT watershed_group_code FROM whse_basemapping.fwa_watershed_groups_poly") # test with just watershed groups noted in param (misses cross-wsg barreriers) -WSGS = $(shell $(PSQL) -AtX -c "SELECT watershed_group_code FROM bcfishpass.parameters_habitat_method") +#WSGS = $(shell $(PSQL) -AtX -c "SELECT watershed_group_code FROM bcfishpass.parameters_habitat_method") # define barrier table targets NATURAL_BARRIERS = .make/barriers_falls \