Project

General

Profile

« Previous | Next » 

Revision 14432

schemas/vegbien.sql: taxon_scrub: documented steps to merge synonymous columns

View differences:

trunk/inputs/.TNRS/schema.sql
1806 1806
SELECT util.recreate_view(''"TNRS".taxon_scrub'', $$
1807 1807
SELECT __
1808 1808
$$);
1809

  
1810
to merge synonymous columns:
1811
# temporarily move correct col out of the way, to allow renaming synonym col:
1812
ALTER TABLE "TNRS".taxon_scrub RENAME "correct_col" TO "_correct_col";
1813
## also perform the rename in any dependent .* views (currently there are none)
1814
# rename columns to replace:
1815
ALTER TABLE "TNRS".taxon_scrub RENAME "synonym_col" TO "correct_col";
1816
## also perform the rename in any dependent .* views (currently there are none)
1817
# remove duplicate cols and now-unnecessary CASE wrappers
1818
SELECT util.recreate_view(''"TNRS".taxon_scrub'', $$
1819
SELECT __ -- with the CASE-wrapped synonym col removed
1820
$$);
1809 1821
';
1810 1822

  
1811 1823

  
trunk/schemas/vegbien.sql
21728 21728
SELECT util.recreate_view(''"TNRS".taxon_scrub'', $$
21729 21729
SELECT __
21730 21730
$$);
21731

  
21732
to merge synonymous columns:
21733
# temporarily move correct col out of the way, to allow renaming synonym col:
21734
ALTER TABLE "TNRS".taxon_scrub RENAME "correct_col" TO "_correct_col";
21735
## also perform the rename in any dependent .* views (currently there are none)
21736
# rename columns to replace:
21737
ALTER TABLE "TNRS".taxon_scrub RENAME "synonym_col" TO "correct_col";
21738
## also perform the rename in any dependent .* views (currently there are none)
21739
# remove duplicate cols and now-unnecessary CASE wrappers
21740
SELECT util.recreate_view(''"TNRS".taxon_scrub'', $$
21741
SELECT __ -- with the CASE-wrapped synonym col removed
21742
$$);
21731 21743
';
21732 21744

  
21733 21745

  

Also available in: Unified diff