1 |
8136
|
aaronmk
|
SELECT functions.to_global_col_names('"SUBPLOT"');
|
2 |
8093
|
aaronmk
|
|
3 |
8098
|
aaronmk
|
SELECT functions.rename_if_exists($$ALTER TABLE "SUBPLOT" RENAME "SUBPLOT.STATECD" TO ".STATECD" $$);
|
4 |
|
|
SELECT functions.rename_if_exists($$ALTER TABLE "SUBPLOT" RENAME "SUBPLOT.UNITCD" TO ".UNITCD" $$);
|
5 |
|
|
SELECT functions.rename_if_exists($$ALTER TABLE "SUBPLOT" RENAME "SUBPLOT.COUNTYCD" TO ".COUNTYCD"$$);
|
6 |
|
|
SELECT functions.rename_if_exists($$ALTER TABLE "SUBPLOT" RENAME "SUBPLOT.PLOT" TO ".PLOT" $$);
|
7 |
|
|
SELECT functions.rename_if_exists($$ALTER TABLE "SUBPLOT" RENAME "SUBPLOT.INVYR" TO ".INVYR" $$);
|
8 |
|
|
SELECT functions.rename_if_exists($$ALTER TABLE "SUBPLOT" RENAME "SUBPLOT.SUBP" TO ".SUBP" $$);
|
9 |
|
|
|
10 |
8136
|
aaronmk
|
SELECT functions.set_col_types('"SUBPLOT"', ARRAY[
|
11 |
8110
|
aaronmk
|
('.STATECD' , 'integer')
|
12 |
|
|
, ('.UNITCD' , 'integer')
|
13 |
|
|
, ('.COUNTYCD', 'integer')
|
14 |
|
|
, ('.PLOT' , 'integer')
|
15 |
|
|
, ('.INVYR' , 'integer')
|
16 |
|
|
, ('.SUBP' , 'integer')
|
17 |
|
|
]::functions.col_cast[]);
|
18 |
|
|
|
19 |
8130
|
aaronmk
|
SELECT functions.create_if_not_exists($$ALTER TABLE "SUBPLOT" ADD CONSTRAINT "SUBPLOT.ID" UNIQUE ("SUBPLOT.CN") $$);
|
20 |
8098
|
aaronmk
|
SELECT functions.create_if_not_exists($$ALTER TABLE "SUBPLOT" ADD CONSTRAINT "SUBPLOT.unique" UNIQUE (".STATECD", ".UNITCD", ".COUNTYCD", ".PLOT", ".INVYR", ".SUBP")$$);
|
21 |
8136
|
aaronmk
|
SELECT functions.cluster_once('"SUBPLOT"', '"SUBPLOT.unique"');
|