Project

General

Profile

1 8163 aaronmk
#!/bin/bash
2
# :mode=transact-sql:
3
cd "$(dirname "$0")"
4
. ../../../lib/import.sh
5
6 8164 aaronmk
map_table
7 8163 aaronmk
psql <<'EOF'
8 8125 aaronmk
-- contains the research station *and state name* for each state
9
10 8184 aaronmk
SELECT set_col_types('"REF_RESEARCH_STATION"', ARRAY[
11 8172 aaronmk
  ('STATECD', 'integer')
12 8184 aaronmk
]::col_cast[]);
13 8125 aaronmk
14 8184 aaronmk
SELECT create_if_not_exists($$ALTER TABLE "REF_RESEARCH_STATION" ADD CONSTRAINT "REF_RESEARCH_STATION.unique" UNIQUE ("STATECD")$$);
15 8208 aaronmk
EOF
16
mk_derived