Revision 8164
Added by Aaron Marcuse-Kubitza over 11 years ago
import | ||
---|---|---|
3 | 3 |
cd "$(dirname "$0")" |
4 | 4 |
. ../../../lib/import.sh |
5 | 5 |
|
6 |
map_table |
|
6 | 7 |
psql <<'EOF' |
7 |
SELECT functions.to_global_col_names('"COUNTY"'); |
|
8 |
|
|
9 |
SELECT functions.rename_if_exists($$ALTER TABLE "COUNTY" RENAME "COUNTY.STATECD" TO ".STATECD" $$); |
|
10 |
SELECT functions.rename_if_exists($$ALTER TABLE "COUNTY" RENAME "COUNTY.UNITCD" TO ".UNITCD" $$); |
|
11 |
SELECT functions.rename_if_exists($$ALTER TABLE "COUNTY" RENAME "COUNTY.COUNTYCD" TO ".COUNTYCD"$$); |
|
12 |
|
|
13 | 8 |
SELECT functions.set_col_types('"COUNTY"', ARRAY[ |
14 | 9 |
('.STATECD' , 'integer') |
15 | 10 |
, ('.UNITCD' , 'integer') |
Also available in: Unified diff
inputs/FIA/*/import: Use map_table to set column names based on the contents of map.csv, instead of using functions.to_global_col_names() and functions.rename_if_exists(). Added map.csv for all tables.