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('"COND"', ARRAY[
8
SELECT util.set_col_types('"COND"', ARRAY[
9 9
  ('STATECD', 'integer')
10 10
, ('UNITCD', 'integer')
11 11
, ('COUNTYCD', 'integer')
12 12
, ('locationName', 'integer')
13 13
, ('INVYR', 'integer')
14 14
, ('authorEventCode', 'integer')
15
]::functions.col_cast[]);
15
]::util.col_cast[]);
16 16

  
17
SELECT functions.create_if_not_exists($$
17
SELECT util.create_if_not_exists($$
18 18
ALTER TABLE "COND" ADD   COLUMN "oldGrowth"      boolean;
19 19
ALTER TABLE "COND" ALTER COLUMN "oldGrowth" TYPE boolean USING
20 20
(
......
30 30
;
31 31
$$);
32 32

  
33
SELECT functions.create_if_not_exists($$ALTER TABLE "COND" ADD CONSTRAINT "COND.ID"     UNIQUE ("COND
33
SELECT util.create_if_not_exists($$ALTER TABLE "COND" ADD CONSTRAINT "COND.ID"     UNIQUE ("COND
34 34
CN")$$);
35
SELECT functions.create_if_not_exists($$ALTER TABLE "COND" ADD CONSTRAINT "COND.unique" UNIQUE ("STATECD", "UNITCD", "COUNTYCD", "locationName", "INVYR", "authorEventCode")$$);
36
SELECT functions.cluster_once('"COND"', '"COND.unique"');
35
SELECT util.create_if_not_exists($$ALTER TABLE "COND" ADD CONSTRAINT "COND.unique" UNIQUE ("STATECD", "UNITCD", "COUNTYCD", "locationName", "INVYR", "authorEventCode")$$);
36
SELECT util.cluster_once('"COND"', '"COND.unique"');

Also available in: Unified diff