Project

General

Profile

« Previous | Next » 

Revision 8166

inputs/FIA/*/map.csv: Removed no longer needed leading . from joined fields (globally-unique terms), because functions.to_global_col_names() is not used anymore

View differences:

inputs/FIA/PLOT/map.csv
4 4
SRV_CN,*PLOT.SRV_CN,,
5 5
CTY_CN,*PLOT.CTY_CN,,
6 6
PREV_PLT_CN,*PLOT.PREV_PLT_CN,,
7
INVYR,.INVYR,,
8
STATECD,.STATECD,,
9
UNITCD,.UNITCD,,
10
COUNTYCD,.COUNTYCD,,
11
PLOT,.PLOT,,
7
INVYR,INVYR,,
8
STATECD,STATECD,,
9
UNITCD,UNITCD,,
10
COUNTYCD,COUNTYCD,,
11
PLOT,PLOT,,
12 12
PLOT_STATUS_CD,*PLOT.PLOT_STATUS_CD,,
13 13
PLOT_NONSAMPLE_REASN_CD,*PLOT.PLOT_NONSAMPLE_REASN_CD,,
14 14
MEASYEAR,*PLOT.MEASYEAR,,
inputs/FIA/PLOT/import
13 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")                                            $$);
17
SELECT functions.create_if_not_exists($$ALTER TABLE "PLOT" ADD CONSTRAINT "PLOT.unique" UNIQUE (".STATECD", ".UNITCD", ".COUNTYCD", ".PLOT", ".INVYR")$$);
16
SELECT functions.create_if_not_exists($$ALTER TABLE "PLOT" ADD CONSTRAINT "PLOT.ID"     UNIQUE ("PLOT.CN")                                       $$);
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"');
inputs/FIA/PLOT/unmapped_terms.csv
3 3
*PLOT.SRV_CN
4 4
*PLOT.CTY_CN
5 5
*PLOT.PREV_PLT_CN
6
.INVYR
7
.STATECD
8
.UNITCD
9
.COUNTYCD
10
.PLOT
6
INVYR
7
STATECD
8
UNITCD
9
COUNTYCD
10
PLOT
11 11
*PLOT.PLOT_STATUS_CD
12 12
*PLOT.PLOT_NONSAMPLE_REASN_CD
13 13
*PLOT.MEASYEAR
inputs/FIA/COUNTY/map.csv
1 1
FIA,VegCore,Filter,Comments
2 2
row_num,*COUNTY.row_num,,
3
STATECD,.STATECD,,
4
UNITCD,.UNITCD,,
5
COUNTYCD,.COUNTYCD,,
3
STATECD,STATECD,,
4
UNITCD,UNITCD,,
5
COUNTYCD,COUNTYCD,,
6 6
COUNTYNM,*COUNTY.COUNTYNM,,
7 7
CN,*COUNTY.CN,,
8 8
CREATED_BY,*COUNTY.CREATED_BY,,
inputs/FIA/COUNTY/import
11 11
, ('.COUNTYCD', 'integer')
12 12
]::functions.col_cast[]);
13 13

  
14
SELECT functions.create_if_not_exists($$ALTER TABLE "COUNTY" ADD CONSTRAINT "COUNTY.ID"     UNIQUE ("COUNTY.CN")                       $$);
15
SELECT functions.create_if_not_exists($$ALTER TABLE "COUNTY" ADD CONSTRAINT "COUNTY.unique" UNIQUE (".STATECD", ".UNITCD", ".COUNTYCD")$$);
14
SELECT functions.create_if_not_exists($$ALTER TABLE "COUNTY" ADD CONSTRAINT "COUNTY.ID"     UNIQUE ("COUNTY.CN")                    $$);
15
SELECT functions.create_if_not_exists($$ALTER TABLE "COUNTY" ADD CONSTRAINT "COUNTY.unique" UNIQUE ("STATECD", "UNITCD", "COUNTYCD")$$);
inputs/FIA/COUNTY/unmapped_terms.csv
1 1
*COUNTY.row_num
2
.STATECD
3
.UNITCD
4
.COUNTYCD
2
STATECD
3
UNITCD
4
COUNTYCD
5 5
*COUNTY.COUNTYNM
6 6
*COUNTY.CN
7 7
*COUNTY.CREATED_BY
inputs/FIA/REF_PLANT_DICTIONARY/map.csv
1 1
FIA,VegCore,Filter,Comments
2 2
row_num,*REF_PLANT_DICTIONARY.row_num,,
3 3
CN,*REF_PLANT_DICTIONARY.CN,,
4
SYMBOL_TYPE,.SYMBOL_TYPE,,
5
SYMBOL,.SYMBOL,,
4
SYMBOL_TYPE,SYMBOL_TYPE,,
5
SYMBOL,SYMBOL,,
6 6
SCIENTIFIC_NAME,*REF_PLANT_DICTIONARY.SCIENTIFIC_NAME,,
7 7
NEW_SYMBOL,*REF_PLANT_DICTIONARY.NEW_SYMBOL,,
8 8
NEW_SCIENTIFIC_NAME,*REF_PLANT_DICTIONARY.NEW_SCIENTIFIC_NAME,,
inputs/FIA/REF_PLANT_DICTIONARY/import
7 7
psql <<'EOF'
8 8
-- Remove 56 duplicate symbols of type 'Old' (these are ambiguous)
9 9
DELETE FROM "REF_PLANT_DICTIONARY"
10
WHERE ".SYMBOL" IN (
11
    SELECT ".SYMBOL"
10
WHERE "SYMBOL" IN (
11
    SELECT "SYMBOL"
12 12
    FROM "REF_PLANT_DICTIONARY"
13
    WHERE ".SYMBOL_TYPE" = 'Old'
14
    GROUP BY ".SYMBOL"
13
    WHERE "SYMBOL_TYPE" = 'Old'
14
    GROUP BY "SYMBOL"
15 15
    HAVING count(*) > 1
16 16
);
17 17

  
18
SELECT functions.create_if_not_exists($$ALTER TABLE "REF_PLANT_DICTIONARY" ADD CONSTRAINT "REF_PLANT_DICTIONARY.unique" UNIQUE (".SYMBOL_TYPE", ".SYMBOL")$$);
18
SELECT functions.create_if_not_exists($$ALTER TABLE "REF_PLANT_DICTIONARY" ADD CONSTRAINT "REF_PLANT_DICTIONARY.unique" UNIQUE ("SYMBOL_TYPE", "SYMBOL")$$);
inputs/FIA/REF_PLANT_DICTIONARY/unmapped_terms.csv
1 1
*REF_PLANT_DICTIONARY.row_num
2 2
*REF_PLANT_DICTIONARY.CN
3
.SYMBOL_TYPE
4
.SYMBOL
3
SYMBOL_TYPE
4
SYMBOL
5 5
*REF_PLANT_DICTIONARY.SCIENTIFIC_NAME
6 6
*REF_PLANT_DICTIONARY.NEW_SYMBOL
7 7
*REF_PLANT_DICTIONARY.NEW_SCIENTIFIC_NAME
inputs/FIA/REF_UNIT/map.csv
1 1
FIA,VegCore,Filter,Comments
2 2
row_num,*REF_UNIT.row_num,,
3
STATECD,.STATECD,,
4
VALUE,.UNITCD,,
3
STATECD,STATECD,,
4
VALUE,UNITCD,,
5 5
MEANING,*REF_UNIT.MEANING,,
6 6
CREATED_BY,*REF_UNIT.CREATED_BY,,
7 7
CREATED_DATE,*REF_UNIT.CREATED_DATE,,
inputs/FIA/REF_UNIT/import
10 10
, ('.UNITCD' , 'integer')
11 11
]::functions.col_cast[]);
12 12

  
13
SELECT functions.create_if_not_exists($$ALTER TABLE "REF_UNIT" ADD CONSTRAINT "REF_UNIT.unique" UNIQUE (".STATECD", ".UNITCD")$$);
13
SELECT functions.create_if_not_exists($$ALTER TABLE "REF_UNIT" ADD CONSTRAINT "REF_UNIT.unique" UNIQUE ("STATECD", "UNITCD")$$);
inputs/FIA/REF_UNIT/new_terms.csv
1 1
row_num,*REF_UNIT.row_num,,
2
VALUE,.UNITCD,,
2
VALUE,UNITCD,,
3 3
MEANING,*REF_UNIT.MEANING,,
4 4
CREATED_BY,*REF_UNIT.CREATED_BY,,
5 5
CREATED_DATE,*REF_UNIT.CREATED_DATE,,
inputs/FIA/REF_UNIT/unmapped_terms.csv
1 1
*REF_UNIT.row_num
2
.STATECD
3
.UNITCD
2
STATECD
3
UNITCD
4 4
*REF_UNIT.MEANING
5 5
*REF_UNIT.CREATED_BY
6 6
*REF_UNIT.CREATED_DATE
inputs/FIA/COND/map.csv
2 2
row_num,*COND.row_num,,
3 3
CN,*COND.CN,,
4 4
PLT_CN,*COND.PLT_CN,,
5
INVYR,.INVYR,,
6
STATECD,.STATECD,,
7
UNITCD,.UNITCD,,
8
COUNTYCD,.COUNTYCD,,
9
PLOT,.PLOT,,
10
CONDID,.CONDID,,
5
INVYR,INVYR,,
6
STATECD,STATECD,,
7
UNITCD,UNITCD,,
8
COUNTYCD,COUNTYCD,,
9
PLOT,PLOT,,
10
CONDID,CONDID,,
11 11
COND_STATUS_CD,*COND.COND_STATUS_CD,,
12 12
COND_NONSAMPLE_REASN_CD,*COND.COND_NONSAMPLE_REASN_CD,,
13 13
RESERVCD,*COND.RESERVCD,,
......
55 55
ALSTK,*COND.ALSTK,,
56 56
GSSTK,*COND.GSSTK,,
57 57
FORTYPCDCALC,*COND.FORTYPCDCALC,,
58
HABTYPCD1,.HABTYPCD,,
59
HABTYPCD1_PUB_CD,.HABTYP_PUB_CD,,
58
HABTYPCD1,HABTYPCD,,
59
HABTYPCD1_PUB_CD,HABTYP_PUB_CD,,
60 60
HABTYPCD1_DESCR_PUB_CD,*COND.HABTYPCD1_DESCR_PUB_CD,,
61 61
HABTYPCD2,*COND.HABTYPCD2,,
62 62
HABTYPCD2_PUB_CD,*COND.HABTYPCD2_PUB_CD,,
inputs/FIA/COND/import
30 30
;
31 31
$$);
32 32

  
33
SELECT functions.create_if_not_exists($$ALTER TABLE "COND" ADD CONSTRAINT "COND.ID"     UNIQUE ("COND.CN")                                                       $$);
34
SELECT functions.create_if_not_exists($$ALTER TABLE "COND" ADD CONSTRAINT "COND.unique" UNIQUE (".STATECD", ".UNITCD", ".COUNTYCD", ".PLOT", ".INVYR", ".CONDID")$$);
33
SELECT functions.create_if_not_exists($$ALTER TABLE "COND" ADD CONSTRAINT "COND.ID"     UNIQUE ("COND.CN")                                                 $$);
34
SELECT functions.create_if_not_exists($$ALTER TABLE "COND" ADD CONSTRAINT "COND.unique" UNIQUE ("STATECD", "UNITCD", "COUNTYCD", "PLOT", "INVYR", "CONDID")$$);
35 35
SELECT functions.cluster_once('"COND"', '"COND.unique"');
inputs/FIA/COND/new_terms.csv
48 48
ALSTK,*COND.ALSTK,,
49 49
GSSTK,*COND.GSSTK,,
50 50
FORTYPCDCALC,*COND.FORTYPCDCALC,,
51
HABTYPCD1,.HABTYPCD,,
52
HABTYPCD1_PUB_CD,.HABTYP_PUB_CD,,
51
HABTYPCD1,HABTYPCD,,
52
HABTYPCD1_PUB_CD,HABTYP_PUB_CD,,
53 53
HABTYPCD1_DESCR_PUB_CD,*COND.HABTYPCD1_DESCR_PUB_CD,,
54 54
HABTYPCD2,*COND.HABTYPCD2,,
55 55
HABTYPCD2_PUB_CD,*COND.HABTYPCD2_PUB_CD,,
inputs/FIA/COND/unmapped_terms.csv
1 1
*COND.row_num
2 2
*COND.CN
3 3
*COND.PLT_CN
4
.INVYR
5
.STATECD
6
.UNITCD
7
.COUNTYCD
8
.PLOT
9
.CONDID
4
INVYR
5
STATECD
6
UNITCD
7
COUNTYCD
8
PLOT
9
CONDID
10 10
*COND.COND_STATUS_CD
11 11
*COND.COND_NONSAMPLE_REASN_CD
12 12
*COND.RESERVCD
......
54 54
*COND.ALSTK
55 55
*COND.GSSTK
56 56
*COND.FORTYPCDCALC
57
.HABTYPCD
58
.HABTYP_PUB_CD
57
HABTYPCD
58
HABTYP_PUB_CD
59 59
*COND.HABTYPCD1_DESCR_PUB_CD
60 60
*COND.HABTYPCD2
61 61
*COND.HABTYPCD2_PUB_CD
inputs/FIA/REF_SPECIES/map.csv
1 1
FIA,VegCore,Filter,Comments
2 2
row_num,*REF_SPECIES.row_num,,
3
SPCD,.SPCD,,
3
SPCD,SPCD,,
4 4
COMMON_NAME,*REF_SPECIES.COMMON_NAME,,
5 5
GENUS,*REF_SPECIES.GENUS,,
6 6
SPECIES,*REF_SPECIES.SPECIES,,
7 7
VARIETY,*REF_SPECIES.VARIETY,,
8 8
SUBSPECIES,*REF_SPECIES.SUBSPECIES,,
9
SPECIES_SYMBOL,.SYMBOL,,
9
SPECIES_SYMBOL,SYMBOL,,
10 10
E_SPGRPCD,*REF_SPECIES.E_SPGRPCD,,
11 11
W_SPGRPCD,*REF_SPECIES.W_SPGRPCD,,
12 12
C_SPGRPCD,*REF_SPECIES.C_SPGRPCD,,
inputs/FIA/REF_SPECIES/import
9 9
  ('.SPCD', 'integer')
10 10
]::functions.col_cast[]);
11 11

  
12
SELECT functions.create_if_not_exists($$ALTER TABLE "REF_SPECIES" ADD COLUMN ".SYMBOL_TYPE" text NOT NULL DEFAULT 'Species'$$);
12
SELECT functions.create_if_not_exists($$ALTER TABLE "REF_SPECIES" ADD COLUMN "SYMBOL_TYPE" text NOT NULL DEFAULT 'Species'$$);
13 13

  
14
SELECT functions.create_if_not_exists($$ALTER TABLE "REF_SPECIES" ADD CONSTRAINT "REF_SPECIES.unique" UNIQUE (".SPCD")$$);
14
SELECT functions.create_if_not_exists($$ALTER TABLE "REF_SPECIES" ADD CONSTRAINT "REF_SPECIES.unique" UNIQUE ("SPCD")$$);
inputs/FIA/REF_SPECIES/new_terms.csv
1 1
row_num,*REF_SPECIES.row_num,,
2 2
COMMON_NAME,*REF_SPECIES.COMMON_NAME,,
3
SPECIES_SYMBOL,.SYMBOL,,
3
SPECIES_SYMBOL,SYMBOL,,
4 4
E_SPGRPCD,*REF_SPECIES.E_SPGRPCD,,
5 5
W_SPGRPCD,*REF_SPECIES.W_SPGRPCD,,
6 6
C_SPGRPCD,*REF_SPECIES.C_SPGRPCD,,
inputs/FIA/REF_SPECIES/unmapped_terms.csv
1 1
*REF_SPECIES.row_num
2
.SPCD
2
SPCD
3 3
*REF_SPECIES.COMMON_NAME
4 4
*REF_SPECIES.GENUS
5 5
*REF_SPECIES.SPECIES
6 6
*REF_SPECIES.VARIETY
7 7
*REF_SPECIES.SUBSPECIES
8
.SYMBOL
8
SYMBOL
9 9
*REF_SPECIES.E_SPGRPCD
10 10
*REF_SPECIES.W_SPGRPCD
11 11
*REF_SPECIES.C_SPGRPCD
inputs/FIA/TREE/map.csv
3 3
CN,*TREE.CN,,
4 4
PLT_CN,*TREE.PLT_CN,,
5 5
PREV_TRE_CN,*TREE.PREV_TRE_CN,,
6
INVYR,.INVYR,,
7
STATECD,.STATECD,,
8
UNITCD,.UNITCD,,
9
COUNTYCD,.COUNTYCD,,
10
PLOT,.PLOT,,
11
SUBP,.SUBP,,
6
INVYR,INVYR,,
7
STATECD,STATECD,,
8
UNITCD,UNITCD,,
9
COUNTYCD,COUNTYCD,,
10
PLOT,PLOT,,
11
SUBP,SUBP,,
12 12
TREE,*TREE.TREE,,
13
CONDID,.CONDID,,
13
CONDID,CONDID,,
14 14
AZIMUTH,*TREE.AZIMUTH,,
15 15
DIST,*TREE.DIST,,
16 16
PREVCOND,*TREE.PREVCOND,,
17 17
STATUSCD,*TREE.STATUSCD,,
18
SPCD,.SPCD,,
18
SPCD,SPCD,,
19 19
SPGRPCD,*TREE.SPGRPCD,,
20 20
DIA,*TREE.DIA,,
21 21
DIAHTCD,*TREE.DIAHTCD,,
inputs/FIA/TREE/import
20 20
SELECT functions.create_if_not_exists($$ALTER TABLE "TREE" ADD CONSTRAINT "TREE.ID" UNIQUE ("TREE.CN")$$);
21 21
SELECT functions.cluster_once('"TREE"', '"TREE.ID"');
22 22

  
23
SELECT functions.create_if_not_exists($$CREATE INDEX "TREE.parent" ON "TREE" (".STATECD", ".UNITCD", ".COUNTYCD", ".PLOT", ".INVYR", ".CONDID", ".SUBP")$$);
23
SELECT functions.create_if_not_exists($$CREATE INDEX "TREE.parent" ON "TREE" ("STATECD", "UNITCD", "COUNTYCD", "PLOT", "INVYR", "CONDID", "SUBP")$$);
inputs/FIA/TREE/unmapped_terms.csv
2 2
*TREE.CN
3 3
*TREE.PLT_CN
4 4
*TREE.PREV_TRE_CN
5
.INVYR
6
.STATECD
7
.UNITCD
8
.COUNTYCD
9
.PLOT
10
.SUBP
5
INVYR
6
STATECD
7
UNITCD
8
COUNTYCD
9
PLOT
10
SUBP
11 11
*TREE.TREE
12
.CONDID
12
CONDID
13 13
*TREE.AZIMUTH
14 14
*TREE.DIST
15 15
*TREE.PREVCOND
16 16
*TREE.STATUSCD
17
.SPCD
17
SPCD
18 18
*TREE.SPGRPCD
19 19
*TREE.DIA
20 20
*TREE.DIAHTCD
inputs/FIA/REF_HABTYP_DESCRIPTION/import
5 5

  
6 6
map_table
7 7
psql <<'EOF'
8
SELECT functions.create_if_not_exists($$ALTER TABLE "REF_HABTYP_DESCRIPTION" ADD CONSTRAINT "REF_HABTYP_DESCRIPTION.unique" UNIQUE (".HABTYPCD", ".HABTYP_PUB_CD")$$);
8
SELECT functions.create_if_not_exists($$ALTER TABLE "REF_HABTYP_DESCRIPTION" ADD CONSTRAINT "REF_HABTYP_DESCRIPTION.unique" UNIQUE ("HABTYPCD", "HABTYP_PUB_CD")$$);
inputs/FIA/REF_HABTYP_DESCRIPTION/unmapped_terms.csv
1 1
*REF_HABTYP_DESCRIPTION.row_num
2 2
*REF_HABTYP_DESCRIPTION.CN
3
.HABTYPCD
4
.HABTYP_PUB_CD
3
HABTYPCD
4
HABTYP_PUB_CD
5 5
*REF_HABTYP_DESCRIPTION.SCIENTIFIC_NAME
6 6
*REF_HABTYP_DESCRIPTION.COMMON_NAME
7 7
*REF_HABTYP_DESCRIPTION.VALID
inputs/FIA/SUBPLOT/import
14 14
, ('.SUBP'    , 'integer')
15 15
]::functions.col_cast[]);
16 16

  
17
SELECT functions.create_if_not_exists($$ALTER TABLE "SUBPLOT" ADD CONSTRAINT "SUBPLOT.ID"     UNIQUE ("SUBPLOT.CN")                                                  $$);
18
SELECT functions.create_if_not_exists($$ALTER TABLE "SUBPLOT" ADD CONSTRAINT "SUBPLOT.unique" UNIQUE (".STATECD", ".UNITCD", ".COUNTYCD", ".PLOT", ".INVYR", ".SUBP")$$);
17
SELECT functions.create_if_not_exists($$ALTER TABLE "SUBPLOT" ADD CONSTRAINT "SUBPLOT.ID"     UNIQUE ("SUBPLOT.CN")                                            $$);
18
SELECT functions.create_if_not_exists($$ALTER TABLE "SUBPLOT" ADD CONSTRAINT "SUBPLOT.unique" UNIQUE ("STATECD", "UNITCD", "COUNTYCD", "PLOT", "INVYR", "SUBP")$$);
19 19
SELECT functions.cluster_once('"SUBPLOT"', '"SUBPLOT.unique"');
inputs/FIA/REF_RESEARCH_STATION/map.csv
1 1
FIA,VegCore,Filter,Comments
2 2
row_num,*REF_RESEARCH_STATION.row_num,,
3
STATECD,.STATECD,,
3
STATECD,STATECD,,
4 4
RSCD,*REF_RESEARCH_STATION.RSCD,,
5 5
RS,*REF_RESEARCH_STATION.RS,,
6 6
STATE_NAME,*REF_RESEARCH_STATION.STATE_NAME,,
inputs/FIA/REF_RESEARCH_STATION/unmapped_terms.csv
1 1
*REF_RESEARCH_STATION.row_num
2
.STATECD
2
STATECD
3 3
*REF_RESEARCH_STATION.RSCD
4 4
*REF_RESEARCH_STATION.RS
5 5
*REF_RESEARCH_STATION.STATE_NAME
inputs/FIA/REF_HABTYP_DESCRIPTION/map.csv
1 1
FIA,VegCore,Filter,Comments
2 2
row_num,*REF_HABTYP_DESCRIPTION.row_num,,
3 3
CN,*REF_HABTYP_DESCRIPTION.CN,,
4
HABTYPCD,.HABTYPCD,,
5
PUB_CD,.HABTYP_PUB_CD,,
4
HABTYPCD,HABTYPCD,,
5
PUB_CD,HABTYP_PUB_CD,,
6 6
SCIENTIFIC_NAME,*REF_HABTYP_DESCRIPTION.SCIENTIFIC_NAME,,
7 7
COMMON_NAME,*REF_HABTYP_DESCRIPTION.COMMON_NAME,,
8 8
VALID,*REF_HABTYP_DESCRIPTION.VALID,,
inputs/FIA/REF_HABTYP_DESCRIPTION/new_terms.csv
1 1
row_num,*REF_HABTYP_DESCRIPTION.row_num,,
2 2
CN,*REF_HABTYP_DESCRIPTION.CN,,
3
PUB_CD,.HABTYP_PUB_CD,,
3
PUB_CD,HABTYP_PUB_CD,,
4 4
COMMON_NAME,*REF_HABTYP_DESCRIPTION.COMMON_NAME,,
5 5
VALID,*REF_HABTYP_DESCRIPTION.VALID,,
6 6
CREATED_BY,*REF_HABTYP_DESCRIPTION.CREATED_BY,,
inputs/FIA/SUBPLOT/map.csv
3 3
CN,*SUBPLOT.CN,,
4 4
PLT_CN,*SUBPLOT.PLT_CN,,
5 5
PREV_SBP_CN,*SUBPLOT.PREV_SBP_CN,,
6
INVYR,.INVYR,,
7
STATECD,.STATECD,,
8
UNITCD,.UNITCD,,
9
COUNTYCD,.COUNTYCD,,
10
PLOT,.PLOT,,
11
SUBP,.SUBP,,
6
INVYR,INVYR,,
7
STATECD,STATECD,,
8
UNITCD,UNITCD,,
9
COUNTYCD,COUNTYCD,,
10
PLOT,PLOT,,
11
SUBP,SUBP,,
12 12
SUBP_STATUS_CD,*SUBPLOT.SUBP_STATUS_CD,,
13 13
POINT_NONSAMPLE_REASN_CD,*SUBPLOT.POINT_NONSAMPLE_REASN_CD,,
14 14
MICRCOND,*SUBPLOT.MICRCOND,,
inputs/FIA/SUBPLOT/unmapped_terms.csv
2 2
*SUBPLOT.CN
3 3
*SUBPLOT.PLT_CN
4 4
*SUBPLOT.PREV_SBP_CN
5
.INVYR
6
.STATECD
7
.UNITCD
8
.COUNTYCD
9
.PLOT
10
.SUBP
5
INVYR
6
STATECD
7
UNITCD
8
COUNTYCD
9
PLOT
10
SUBP
11 11
*SUBPLOT.SUBP_STATUS_CD
12 12
*SUBPLOT.POINT_NONSAMPLE_REASN_CD
13 13
*SUBPLOT.MICRCOND
inputs/FIA/REF_RESEARCH_STATION/import
11 11
  ('.STATECD' , 'integer')
12 12
]::functions.col_cast[]);
13 13

  
14
SELECT functions.create_if_not_exists($$ALTER TABLE "REF_RESEARCH_STATION" ADD CONSTRAINT "REF_RESEARCH_STATION.unique" UNIQUE (".STATECD")$$);
14
SELECT functions.create_if_not_exists($$ALTER TABLE "REF_RESEARCH_STATION" ADD CONSTRAINT "REF_RESEARCH_STATION.unique" UNIQUE ("STATECD")$$);

Also available in: Unified diff