Project

General

Profile

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