Revision 8208
Added by Aaron Marcuse-Kubitza over 11 years ago
inputs/FIA/PLOT/import | ||
---|---|---|
16 | 16 |
SELECT create_if_not_exists($$ALTER TABLE "PLOT" ADD CONSTRAINT "PLOT.ID" UNIQUE ("locationID")$$); |
17 | 17 |
SELECT create_if_not_exists($$ALTER TABLE "PLOT" ADD CONSTRAINT "PLOT.unique" UNIQUE ("STATECD", "UNITCD", "COUNTYCD", "locationName", "INVYR")$$); |
18 | 18 |
SELECT cluster_once('"PLOT"', '"PLOT.unique"'); |
19 |
EOF |
|
20 |
mk_derived |
inputs/FIA/COUNTY/import | ||
---|---|---|
14 | 14 |
SELECT create_if_not_exists($$ALTER TABLE "COUNTY" ADD CONSTRAINT "COUNTY.ID" UNIQUE ("COUNTY |
15 | 15 |
CN")$$); |
16 | 16 |
SELECT create_if_not_exists($$ALTER TABLE "COUNTY" ADD CONSTRAINT "COUNTY.unique" UNIQUE ("STATECD", "UNITCD", "COUNTYCD")$$); |
17 |
EOF |
|
18 |
mk_derived |
inputs/FIA/REF_PLANT_DICTIONARY/import | ||
---|---|---|
16 | 16 |
); |
17 | 17 |
|
18 | 18 |
SELECT create_if_not_exists($$ALTER TABLE "REF_PLANT_DICTIONARY" ADD CONSTRAINT "REF_PLANT_DICTIONARY.unique" UNIQUE ("PLANT_SYMBOL_TYPE", "PLANT_SYMBOL")$$); |
19 |
EOF |
|
20 |
mk_derived |
inputs/FIA/REF_UNIT/import | ||
---|---|---|
11 | 11 |
]::col_cast[]); |
12 | 12 |
|
13 | 13 |
SELECT create_if_not_exists($$ALTER TABLE "REF_UNIT" ADD CONSTRAINT "REF_UNIT.unique" UNIQUE ("STATECD", "UNITCD")$$); |
14 |
EOF |
|
15 |
mk_derived |
inputs/FIA/COND/import | ||
---|---|---|
46 | 46 |
CN")$$); |
47 | 47 |
SELECT create_if_not_exists($$ALTER TABLE "COND" ADD CONSTRAINT "COND.unique" UNIQUE ("STATECD", "UNITCD", "COUNTYCD", "locationName", "INVYR", "authorEventCode")$$); |
48 | 48 |
SELECT cluster_once('"COND"', '"COND.unique"'); |
49 |
EOF |
|
50 |
mk_derived |
inputs/FIA/REF_SPECIES/import | ||
---|---|---|
12 | 12 |
SELECT mk_const_col(('"REF_SPECIES"', 'PLANT_SYMBOL_TYPE'), 'Species'::text); |
13 | 13 |
|
14 | 14 |
SELECT create_if_not_exists($$ALTER TABLE "REF_SPECIES" ADD CONSTRAINT "REF_SPECIES.unique" UNIQUE ("SPCD")$$); |
15 |
EOF |
|
16 |
mk_derived |
inputs/FIA/TREE/import | ||
---|---|---|
21 | 21 |
SELECT cluster_once('"TREE"', '"TREE.ID"'); |
22 | 22 |
|
23 | 23 |
SELECT create_if_not_exists($$CREATE INDEX "TREE.parent" ON "TREE" ("STATECD", "UNITCD", "COUNTYCD", "locationName", "INVYR", "authorEventCode", "subplot")$$); |
24 |
EOF |
|
25 |
mk_derived |
inputs/FIA/REF_HABTYP_DESCRIPTION/import | ||
---|---|---|
6 | 6 |
map_table |
7 | 7 |
psql <<'EOF' |
8 | 8 |
SELECT create_if_not_exists($$ALTER TABLE "REF_HABTYP_DESCRIPTION" ADD CONSTRAINT "REF_HABTYP_DESCRIPTION.unique" UNIQUE ("HABTYPCD", "HABTYP_PUB_CD")$$); |
9 |
EOF |
|
10 |
mk_derived |
inputs/FIA/SUBPLOT/import | ||
---|---|---|
17 | 17 |
SELECT create_if_not_exists($$ALTER TABLE "SUBPLOT" ADD CONSTRAINT "SUBPLOT.ID" UNIQUE ("subplotID")$$); |
18 | 18 |
SELECT create_if_not_exists($$ALTER TABLE "SUBPLOT" ADD CONSTRAINT "SUBPLOT.unique" UNIQUE ("STATECD", "UNITCD", "COUNTYCD", "locationName", "INVYR", "subplot")$$); |
19 | 19 |
SELECT cluster_once('"SUBPLOT"', '"SUBPLOT.unique"'); |
20 |
EOF |
|
21 |
mk_derived |
inputs/FIA/REF_RESEARCH_STATION/import | ||
---|---|---|
12 | 12 |
]::col_cast[]); |
13 | 13 |
|
14 | 14 |
SELECT create_if_not_exists($$ALTER TABLE "REF_RESEARCH_STATION" ADD CONSTRAINT "REF_RESEARCH_STATION.unique" UNIQUE ("STATECD")$$); |
15 |
EOF |
|
16 |
mk_derived |
Also available in: Unified diff
inputs/FIA/*/import: Run mk_derived after postprocessing commands