Revision 8172
Added by Aaron Marcuse-Kubitza over 11 years ago
import | ||
---|---|---|
6 | 6 |
map_table |
7 | 7 |
psql <<'EOF' |
8 | 8 |
SELECT functions.set_col_types('"TREE"', ARRAY[ |
9 |
('STATECD' , 'integer')
|
|
10 |
, ('UNITCD' , 'integer')
|
|
9 |
('STATECD', 'integer') |
|
10 |
, ('UNITCD', 'integer') |
|
11 | 11 |
, ('COUNTYCD', 'integer') |
12 |
, ('PLOT' , 'integer')
|
|
13 |
, ('INVYR' , 'integer')
|
|
14 |
, ('SUBP' , 'integer')
|
|
15 |
, ('CONDID' , 'integer')
|
|
16 |
, ('SPCD' , 'integer')
|
|
12 |
, ('locationName', 'integer')
|
|
13 |
, ('INVYR', 'integer') |
|
14 |
, ('subplot', 'integer')
|
|
15 |
, ('authorEventCode', 'integer')
|
|
16 |
, ('SPCD', 'integer') |
|
17 | 17 |
]::functions.col_cast[]); |
18 | 18 |
|
19 |
-- ("STATECD", "UNITCD", "COUNTYCD", "PLOT", "INVYR", "CONDID", "SUBP", "TREE", "STATUSCD") is not ID
|
|
20 |
SELECT functions.create_if_not_exists($$ALTER TABLE "TREE" ADD CONSTRAINT "TREE.ID" UNIQUE ("*TREE.CN")$$);
|
|
19 |
-- ("STATECD", "UNITCD", "COUNTYCD", "locationName", "INVYR", "authorEventCode", "subplot", "TREE", "STATUSCD") is not ID
|
|
20 |
SELECT functions.create_if_not_exists($$ALTER TABLE "TREE" ADD CONSTRAINT "TREE.ID" UNIQUE ("individualObservationID")$$);
|
|
21 | 21 |
SELECT functions.cluster_once('"TREE"', '"TREE.ID"'); |
22 | 22 |
|
23 |
SELECT functions.create_if_not_exists($$CREATE INDEX "TREE.parent" ON "TREE" ("STATECD", "UNITCD", "COUNTYCD", "PLOT", "INVYR", "CONDID", "SUBP")$$); |
|
23 |
SELECT functions.create_if_not_exists($$CREATE INDEX "TREE.parent" ON "TREE" ("STATECD", "UNITCD", "COUNTYCD", "locationName", "INVYR", "authorEventCode", "subplot")$$); |
Also available in: Unified diff
inputs/FIA/*/map.csv: Mapped terms to VegCore