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