Project

General

Profile

« Previous | Next » 

Revision 8127

inputs/FIA/REF_SPECIES/postprocess.sql: Matched SPECIES_SYMBOL to .SYMBOL. Added .SYMBOL_TYPE for use in joining to REF_PLANT_DICTIONARY.

View differences:

inputs/FIA/REF_SPECIES/postprocess.sql
1 1
SELECT functions.to_global_col_names(:table_str);
2 2

  
3
SELECT functions.rename_if_exists($$ALTER TABLE "REF_SPECIES" RENAME "REF_SPECIES.SPCD" TO ".SPCD"$$);
3
SELECT functions.rename_if_exists($$ALTER TABLE "REF_SPECIES" RENAME "REF_SPECIES.SPCD"           TO ".SPCD"  $$);
4
SELECT functions.rename_if_exists($$ALTER TABLE "REF_SPECIES" RENAME "REF_SPECIES.SPECIES_SYMBOL" TO ".SYMBOL"$$);
4 5

  
5 6
SELECT functions.set_col_types(:table_str, ARRAY[
6 7
  ('.SPCD', 'integer')
7 8
]::functions.col_cast[]);
8 9

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

  
9 12
SELECT functions.create_if_not_exists($$ALTER TABLE "REF_SPECIES" ADD CONSTRAINT "REF_SPECIES.unique" UNIQUE (".SPCD")$$);

Also available in: Unified diff