From 458ad5604dd894891f72d0daaf649e26e711f37c Mon Sep 17 00:00:00 2001 From: Simon Norris Date: Fri, 5 Jan 2024 13:05:52 -0800 Subject: [PATCH] reorder db build --- db/functions/wsg_crossing_summary.sql | 2 +- db/functions/wsg_linear_summary.sql | 1 + db/setup.sh | 4 ++-- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/db/functions/wsg_crossing_summary.sql b/db/functions/wsg_crossing_summary.sql index e7b811a8..e24e6f61 100644 --- a/db/functions/wsg_crossing_summary.sql +++ b/db/functions/wsg_crossing_summary.sql @@ -5,7 +5,7 @@ CREATE FUNCTION bcfishpass.wsg_crossings_summary() RETURNS table ( -watershed_group_code text, + watershed_group_code text, crossing_feature_type text, n_crossings_total integer, n_passable_total integer, diff --git a/db/functions/wsg_linear_summary.sql b/db/functions/wsg_linear_summary.sql index bc1fe1ad..4922dcb6 100644 --- a/db/functions/wsg_linear_summary.sql +++ b/db/functions/wsg_linear_summary.sql @@ -10,6 +10,7 @@ -- - spawning or rearing habitat not isolated by dam or a known pscis barrier (accessible_a) -- - spawning or rearing habitat not isolated by all anthropogenic barriers (observed and modelled) (accessible_b) +DROP FUNCTION bcfishpass.wsg_linear_summary(); CREATE FUNCTION bcfishpass.wsg_linear_summary() RETURNS table ( watershed_group_code text, diff --git a/db/setup.sh b/db/setup.sh index d083ad60..999707dd 100755 --- a/db/setup.sh +++ b/db/setup.sh @@ -12,10 +12,10 @@ for sql in tables/*.sql ; do $PSQL -f "$sql" done -for sql in functions/*.sql ; do +for sql in views/*.sql ; do $PSQL -f "$sql" done -for sql in views/*.sql ; do +for sql in functions/*.sql ; do $PSQL -f "$sql" done \ No newline at end of file