Revision 8183
Added by Aaron Marcuse-Kubitza almost 12 years ago
import | ||
---|---|---|
5 | 5 |
|
6 | 6 |
map_table |
7 | 7 |
psql <<'EOF' |
8 |
SELECT functions.set_col_types('"PLOT"', ARRAY[
|
|
8 |
SELECT util.set_col_types('"PLOT"', ARRAY[
|
|
9 | 9 |
('STATECD', 'integer') |
10 | 10 |
, ('UNITCD', 'integer') |
11 | 11 |
, ('COUNTYCD', 'integer') |
12 | 12 |
, ('locationName', 'integer') |
13 | 13 |
, ('INVYR', 'integer') |
14 |
]::functions.col_cast[]);
|
|
14 |
]::util.col_cast[]);
|
|
15 | 15 |
|
16 |
SELECT functions.create_if_not_exists($$ALTER TABLE "PLOT" ADD CONSTRAINT "PLOT.ID" UNIQUE ("locationID")$$); |
|
17 |
SELECT functions.create_if_not_exists($$ALTER TABLE "PLOT" ADD CONSTRAINT "PLOT.unique" UNIQUE ("STATECD", "UNITCD", "COUNTYCD", "locationName", "INVYR")$$); |
|
18 |
SELECT functions.cluster_once('"PLOT"', '"PLOT.unique"'); |
|
16 |
SELECT util.create_if_not_exists($$ALTER TABLE "PLOT" ADD CONSTRAINT "PLOT.ID" UNIQUE ("locationID")$$); |
|
17 |
SELECT util.create_if_not_exists($$ALTER TABLE "PLOT" ADD CONSTRAINT "PLOT.unique" UNIQUE ("STATECD", "UNITCD", "COUNTYCD", "locationName", "INVYR")$$); |
|
18 |
SELECT util.cluster_once('"PLOT"', '"PLOT.unique"'); |
Also available in: Unified diff
schemas/*functions.sql: Renamed to *util.sql because now that these schemas are used by the new-style import scripts, there can be more than just functions in them