Project

General

Profile

« Previous | Next » 

Revision 8183

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

View differences:

import
5 5

  
6 6
map_table
7 7
psql <<'EOF'
8
SELECT functions.set_col_types('"SUBPLOT"', ARRAY[
8
SELECT util.set_col_types('"SUBPLOT"', ARRAY[
9 9
  ('STATECD', 'integer')
10 10
, ('UNITCD', 'integer')
11 11
, ('COUNTYCD', 'integer')
12 12
, ('locationName', 'integer')
13 13
, ('INVYR', 'integer')
14 14
, ('subplot', 'integer')
15
]::functions.col_cast[]);
15
]::util.col_cast[]);
16 16

  
17
SELECT functions.create_if_not_exists($$ALTER TABLE "SUBPLOT" ADD CONSTRAINT "SUBPLOT.ID"     UNIQUE ("subplotID")$$);
18
SELECT functions.create_if_not_exists($$ALTER TABLE "SUBPLOT" ADD CONSTRAINT "SUBPLOT.unique" UNIQUE ("STATECD", "UNITCD", "COUNTYCD", "locationName", "INVYR", "subplot")$$);
19
SELECT functions.cluster_once('"SUBPLOT"', '"SUBPLOT.unique"');
17
SELECT util.create_if_not_exists($$ALTER TABLE "SUBPLOT" ADD CONSTRAINT "SUBPLOT.ID"     UNIQUE ("subplotID")$$);
18
SELECT util.create_if_not_exists($$ALTER TABLE "SUBPLOT" ADD CONSTRAINT "SUBPLOT.unique" UNIQUE ("STATECD", "UNITCD", "COUNTYCD", "locationName", "INVYR", "subplot")$$);
19
SELECT util.cluster_once('"SUBPLOT"', '"SUBPLOT.unique"');

Also available in: Unified diff