Project

General

Profile

« Previous | Next » 

Revision 11955

inputs/VegBank/vegbank.~.clean_up.sql, inputs/CVS/cvs.~.clean_up.sql: Prevent "column name specified more than once" errors when tables are joined: put tables in alphabetical order for consistency

View differences:

inputs/CVS/cvs.~.clean_up.sql
6 6
ALTER TABLE "stemCount" RENAME "TAXONIMPORTANCE_ID" TO "taxonImportance_ID";
7 7

  
8 8
-- Prevent "column name specified more than once" errors when tables are joined
9
ALTER TABLE "observationContributor" RENAME "dba_src_ID" TO "observationContributor--dba_src_ID";
10 9
ALTER TABLE "commClass" RENAME "commName" TO "commClass--commName";
11 10
ALTER TABLE "commClass" RENAME "commLevel" TO "commClass--commLevel";
12 11
ALTER TABLE "commClass" RENAME "accessionCode" TO "commClass--accessionCode";
13 12
ALTER TABLE "commClass" RENAME "dba_src_ID" TO "commClass--dba_src_ID";
14 13
ALTER TABLE "commConcept" RENAME "dba_src_ID" TO "commConcept--dba_src_ID";
14
ALTER TABLE "observationContributor" RENAME "dba_src_ID" TO "observationContributor--dba_src_ID";
15
ALTER TABLE "plantConcept" RENAME "reference_ID" TO "plantConcept_reference_ID";
16
ALTER TABLE "plantConcept" RENAME "accessionCode" TO "plantConcept_accessionCode";
17
ALTER TABLE "plantConcept" RENAME "dba_src_ID" TO "plantConcept_dba_src_ID";
18
ALTER TABLE "plantConcept" RENAME "entry_sppID" TO "plantConcept_entry_sppID";
15 19
ALTER TABLE "soilObs" RENAME "dba_src_ID" TO "soilObs_dba_src_ID";
16
ALTER TABLE "taxonObservation" RENAME "reference_ID" TO "taxonObservation_reference_ID";
17
ALTER TABLE "taxonObservation" RENAME "accessionCode" TO "taxonObservation_accessionCode";
18
ALTER TABLE "taxonObservation" RENAME "dba_src_ID" TO "taxonObservation_dba_src_ID";
19
ALTER TABLE "taxonObservation" RENAME "entry_sppID" TO "taxonObservation_entry_sppID";
20
ALTER TABLE "taxonImportance" RENAME "dba_src_ID" TO "taxonImportance_dba_src_ID";
21
ALTER TABLE "taxonImportance" RENAME "entry_herbLineID" TO "taxonImportance_entry_herbLineID";
22
ALTER TABLE "taxonImportance" RENAME "entry_treeLineID" TO "taxonImportance_entry_treeLineID";
23 20
ALTER TABLE "stemCount" RENAME "dba_src_ID" TO "stemCount_dba_src_ID";
24 21
ALTER TABLE "stemCount" RENAME "entry_herbLineID" TO "stemCount_entry_herbLineID";
25 22
ALTER TABLE "stemCount" RENAME "entry_treeLineID" TO "stemCount_entry_treeLineID";
26 23
ALTER TABLE "stemCount" RENAME "entry_sortOrder" TO "stemCount_entry_sortOrder";
27 24
ALTER TABLE "stemLocation" RENAME "entry_sortOrder" TO "stemLocation_entry_sortOrder";
25
ALTER TABLE "taxonImportance" RENAME "dba_src_ID" TO "taxonImportance_dba_src_ID";
26
ALTER TABLE "taxonImportance" RENAME "entry_herbLineID" TO "taxonImportance_entry_herbLineID";
27
ALTER TABLE "taxonImportance" RENAME "entry_treeLineID" TO "taxonImportance_entry_treeLineID";
28 28
ALTER TABLE "taxonInterpretation" RENAME "PLANTNAME_ID" TO "taxonInterpretation_PLANTNAME_ID";
29 29
ALTER TABLE "taxonInterpretation" RENAME "dba_src_ID" TO "taxonInterpretation_dba_src_ID";
30 30
ALTER TABLE "taxonInterpretation" RENAME "accessionCode" TO "taxonInterpretation_accessionCode";
31
ALTER TABLE "plantConcept" RENAME "reference_ID" TO "plantConcept_reference_ID";
32
ALTER TABLE "plantConcept" RENAME "accessionCode" TO "plantConcept_accessionCode";
33
ALTER TABLE "plantConcept" RENAME "dba_src_ID" TO "plantConcept_dba_src_ID";
34
ALTER TABLE "plantConcept" RENAME "entry_sppID" TO "plantConcept_entry_sppID";
31
ALTER TABLE "taxonObservation" RENAME "reference_ID" TO "taxonObservation_reference_ID";
32
ALTER TABLE "taxonObservation" RENAME "accessionCode" TO "taxonObservation_accessionCode";
33
ALTER TABLE "taxonObservation" RENAME "dba_src_ID" TO "taxonObservation_dba_src_ID";
34
ALTER TABLE "taxonObservation" RENAME "entry_sppID" TO "taxonObservation_entry_sppID";
inputs/VegBank/vegbank.~.clean_up.sql
434 434
ALTER TABLE commclass RENAME commcode  TO commclass__commcode;
435 435
ALTER TABLE commclass RENAME commname  TO commclass__commname;
436 436
ALTER TABLE commconcept RENAME commname  TO commconcept__commname;
437
ALTER TABLE taxonobservation RENAME reference_id  TO taxonobservation_reference_id;
438
ALTER TABLE taxonobservation RENAME accessioncode  TO taxonobservation_accessioncode;
439
ALTER TABLE taxoninterpretation RENAME plantname_id  TO taxoninterpretation_plantname_id;
440
ALTER TABLE taxoninterpretation RENAME accessioncode  TO taxoninterpretation_accessioncode;
441 437
ALTER TABLE party RENAME d_obscount  TO party_d_obscount;
442 438
ALTER TABLE plantconcept RENAME reference_id  TO plantconcept_reference_id;
443 439
ALTER TABLE plantconcept RENAME plantname  TO plantconcept_plantname;
444 440
ALTER TABLE plantconcept RENAME accessioncode  TO plantconcept_accessioncode;
445 441
ALTER TABLE plantname RENAME reference_id  TO plantname_reference_id;
442
ALTER TABLE taxoninterpretation RENAME plantname_id  TO taxoninterpretation_plantname_id;
443
ALTER TABLE taxoninterpretation RENAME accessioncode  TO taxoninterpretation_accessioncode;
444
ALTER TABLE taxonobservation RENAME reference_id  TO taxonobservation_reference_id;
445
ALTER TABLE taxonobservation RENAME accessioncode  TO taxonobservation_accessioncode;
446 446

  
447 447
-- indicate required columns
448 448
--ALTER TABLE comminterpretation ALTER COLUMN commname SET NOT NULL; -- now NULL in 10 rows, where commconcept_id is also NULL

Also available in: Unified diff