Revision 8130
Added by Aaron Marcuse-Kubitza over 11 years ago
inputs/FIA/PLOT/postprocess.sql | ||
---|---|---|
14 | 14 |
, ('.INVYR' , 'integer') |
15 | 15 |
]::functions.col_cast[]); |
16 | 16 |
|
17 |
SELECT functions.create_if_not_exists($$ALTER TABLE "PLOT" ADD CONSTRAINT "PLOT.ID" UNIQUE ("PLOT.CN") $$); |
|
17 | 18 |
SELECT functions.create_if_not_exists($$ALTER TABLE "PLOT" ADD CONSTRAINT "PLOT.unique" UNIQUE (".STATECD", ".UNITCD", ".COUNTYCD", ".PLOT", ".INVYR")$$); |
18 | 19 |
SELECT functions.cluster_once(:table_str, '"PLOT.unique"'); |
inputs/FIA/COUNTY/postprocess.sql | ||
---|---|---|
10 | 10 |
, ('.COUNTYCD', 'integer') |
11 | 11 |
]::functions.col_cast[]); |
12 | 12 |
|
13 |
SELECT functions.create_if_not_exists($$ALTER TABLE "COUNTY" ADD CONSTRAINT "COUNTY.ID" UNIQUE ("COUNTY.CN") $$); |
|
13 | 14 |
SELECT functions.create_if_not_exists($$ALTER TABLE "COUNTY" ADD CONSTRAINT "COUNTY.unique" UNIQUE (".STATECD", ".UNITCD", ".COUNTYCD")$$); |
inputs/FIA/COND/postprocess.sql | ||
---|---|---|
34 | 34 |
; |
35 | 35 |
$$); |
36 | 36 |
|
37 |
SELECT functions.create_if_not_exists($$ALTER TABLE "COND" ADD CONSTRAINT "COND.ID" UNIQUE ("COND.CN") $$); |
|
37 | 38 |
SELECT functions.create_if_not_exists($$ALTER TABLE "COND" ADD CONSTRAINT "COND.unique" UNIQUE (".STATECD", ".UNITCD", ".COUNTYCD", ".PLOT", ".INVYR", ".CONDID")$$); |
38 | 39 |
SELECT functions.cluster_once(:table_str, '"COND.unique"'); |
inputs/FIA/SUBPLOT/postprocess.sql | ||
---|---|---|
16 | 16 |
, ('.SUBP' , 'integer') |
17 | 17 |
]::functions.col_cast[]); |
18 | 18 |
|
19 |
SELECT functions.create_if_not_exists($$ALTER TABLE "SUBPLOT" ADD CONSTRAINT "SUBPLOT.ID" UNIQUE ("SUBPLOT.CN") $$); |
|
19 | 20 |
SELECT functions.create_if_not_exists($$ALTER TABLE "SUBPLOT" ADD CONSTRAINT "SUBPLOT.unique" UNIQUE (".STATECD", ".UNITCD", ".COUNTYCD", ".PLOT", ".INVYR", ".SUBP")$$); |
20 | 21 |
SELECT functions.cluster_once(:table_str, '"SUBPLOT.unique"'); |
Also available in: Unified diff
inputs/FIA/*/postprocess.sql: Added index on *.CN (autogen IDs)