Revision 8184
Added by Aaron Marcuse-Kubitza almost 12 years ago
import | ||
---|---|---|
5 | 5 |
|
6 | 6 |
map_table |
7 | 7 |
psql <<'EOF' |
8 |
SELECT util.set_col_types('"COND"', ARRAY[
|
|
8 |
SELECT set_col_types('"COND"', ARRAY[ |
|
9 | 9 |
('STATECD', 'integer') |
10 | 10 |
, ('UNITCD', 'integer') |
11 | 11 |
, ('COUNTYCD', 'integer') |
12 | 12 |
, ('locationName', 'integer') |
13 | 13 |
, ('INVYR', 'integer') |
14 | 14 |
, ('authorEventCode', 'integer') |
15 |
]::util.col_cast[]);
|
|
15 |
]::col_cast[]); |
|
16 | 16 |
|
17 |
SELECT util.create_if_not_exists($$
|
|
17 |
SELECT create_if_not_exists($$ |
|
18 | 18 |
ALTER TABLE "COND" ADD COLUMN "oldGrowth" boolean; |
19 | 19 |
ALTER TABLE "COND" ALTER COLUMN "oldGrowth" TYPE boolean USING |
20 | 20 |
( |
... | ... | |
30 | 30 |
; |
31 | 31 |
$$); |
32 | 32 |
|
33 |
SELECT util.create_if_not_exists($$ALTER TABLE "COND" ADD CONSTRAINT "COND.ID" UNIQUE ("COND
|
|
33 |
SELECT create_if_not_exists($$ALTER TABLE "COND" ADD CONSTRAINT "COND.ID" UNIQUE ("COND |
|
34 | 34 |
CN")$$); |
35 |
SELECT util.create_if_not_exists($$ALTER TABLE "COND" ADD CONSTRAINT "COND.unique" UNIQUE ("STATECD", "UNITCD", "COUNTYCD", "locationName", "INVYR", "authorEventCode")$$); |
|
36 |
SELECT util.cluster_once('"COND"', '"COND.unique"'); |
|
35 |
SELECT create_if_not_exists($$ALTER TABLE "COND" ADD CONSTRAINT "COND.unique" UNIQUE ("STATECD", "UNITCD", "COUNTYCD", "locationName", "INVYR", "authorEventCode")$$); |
|
36 |
SELECT cluster_once('"COND"', '"COND.unique"'); |
Also available in: Unified diff
inputs/FIA/*/import: Removed util. before function names because util is in the search_path