Project

General

Profile

« Previous | Next » 

Revision 8110

inputs/FIA/*/postprocess.sql: Cast ID columns to integer using new functions.set_col_types()

View differences:

postprocess.sql
7 7
SELECT functions.rename_if_exists($$ALTER TABLE "COND" RENAME "COND.INVYR"    TO ".INVYR"   $$);
8 8
SELECT functions.rename_if_exists($$ALTER TABLE "COND" RENAME "COND.CONDID"   TO ".CONDID"  $$);
9 9

  
10
SELECT functions.set_col_types(:table_str, ARRAY[
11
  ('.STATECD' , 'integer')
12
, ('.UNITCD'  , 'integer')
13
, ('.COUNTYCD', 'integer')
14
, ('.PLOT'    , 'integer')
15
, ('.INVYR'   , 'integer')
16
, ('.CONDID'  , 'integer')
17
]::functions.col_cast[]);
18

  
10 19
SELECT functions.create_if_not_exists($$
11 20
ALTER TABLE "COND" ADD   COLUMN "COND.oldgrowth"      boolean;
12 21
ALTER TABLE "COND" ALTER COLUMN "COND.oldgrowth" TYPE boolean USING

Also available in: Unified diff