1 |
10084
|
aaronmk
|
SELECT util.search_path_append('util');
|
2 |
8163
|
aaronmk
|
|
3 |
8184
|
aaronmk
|
SELECT set_col_types('"SUBPLOT"', ARRAY[
|
4 |
10054
|
aaronmk
|
('*STATECD', 'integer')
|
5 |
|
|
, ('*UNITCD', 'integer')
|
6 |
|
|
, ('*COUNTYCD', 'integer')
|
7 |
8172
|
aaronmk
|
, ('locationName', 'integer')
|
8 |
10054
|
aaronmk
|
, ('*INVYR', 'integer')
|
9 |
8172
|
aaronmk
|
, ('subplot', 'integer')
|
10 |
8184
|
aaronmk
|
]::col_cast[]);
|
11 |
8110
|
aaronmk
|
|
12 |
8184
|
aaronmk
|
SELECT create_if_not_exists($$ALTER TABLE "SUBPLOT" ADD CONSTRAINT "SUBPLOT.ID" UNIQUE ("subplotID")$$);
|
13 |
10054
|
aaronmk
|
SELECT create_if_not_exists($$ALTER TABLE "SUBPLOT" ADD CONSTRAINT "SUBPLOT.unique" UNIQUE ("*STATECD", "*UNITCD", "*COUNTYCD", "locationName", "*INVYR", "subplot")$$);
|
14 |
8184
|
aaronmk
|
SELECT cluster_once('"SUBPLOT"', '"SUBPLOT.unique"');
|