Project

General

Profile

« Previous | Next » 

Revision 8170

inputs/FIA/*/import: Updated column names to match map.csv

View differences:

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

  
16
SELECT functions.create_if_not_exists($$ALTER TABLE "PLOT" ADD CONSTRAINT "PLOT.ID"     UNIQUE ("PLOT.CN")                                       $$);
16
SELECT functions.create_if_not_exists($$ALTER TABLE "PLOT" ADD CONSTRAINT "PLOT.ID"     UNIQUE ("*PLOT.CN")                                      $$);
17 17
SELECT functions.create_if_not_exists($$ALTER TABLE "PLOT" ADD CONSTRAINT "PLOT.unique" UNIQUE ("STATECD", "UNITCD", "COUNTYCD", "PLOT", "INVYR")$$);
18 18
SELECT functions.cluster_once('"PLOT"', '"PLOT.unique"');

Also available in: Unified diff