Project

General

Profile

« Previous | Next » 

Revision 5232

schemas/vegbien.sql: taxonconcept: Moved concept_reference_id to the top of the table because it is now a key scoping field

View differences:

schemas/vegbien.my.sql
766 766
CREATE TABLE taxonconcept (
767 767
    taxonconcept_id int(11) NOT NULL,
768 768
    datasource_id int(11) NOT NULL,
769
    concept_reference_id int(11),
769 770
    identifyingtaxonomicname text,
770 771
    canon_taxonconcept_id int(11),
771 772
    taxon_id int(11),
......
786 787
    cultivar text,
787 788
    morphospecies text,
788 789
    otherranks text,
789
    concept_reference_id int(11),
790 790
    accessioncode text
791 791
);
792 792

  
......
799 799

  
800 800

  
801 801
--
802
-- Name: COLUMN taxonconcept.concept_reference_id; Type: COMMENT; Schema: public; Owner: -
803
--
804

  
805

  
806

  
807

  
808
--
802 809
-- Name: COLUMN taxonconcept.identifyingtaxonomicname; Type: COMMENT; Schema: public; Owner: -
803 810
--
804 811

  
......
939 946

  
940 947

  
941 948
--
942
-- Name: COLUMN taxonconcept.concept_reference_id; Type: COMMENT; Schema: public; Owner: -
943
--
944

  
945

  
946

  
947

  
948
--
949 949
-- Name: taxondetermination; Type: TABLE; Schema: public; Owner: -; Tablespace: 
950 950
--
951 951

  
schemas/vegbien.sql
1087 1087
CREATE TABLE taxonconcept (
1088 1088
    taxonconcept_id integer NOT NULL,
1089 1089
    datasource_id integer NOT NULL,
1090
    concept_reference_id integer,
1090 1091
    identifyingtaxonomicname text,
1091 1092
    canon_taxonconcept_id integer,
1092 1093
    taxon_id integer,
......
1107 1108
    cultivar text,
1108 1109
    morphospecies text,
1109 1110
    otherranks rankedtaxonname[],
1110
    concept_reference_id integer,
1111 1111
    accessioncode text,
1112 1112
    CONSTRAINT taxonconcept_required_key CHECK (((((((identifyingtaxonomicname IS NOT NULL) OR (taxonomicname IS NOT NULL)) OR (taxonomicnamewithauthor IS NOT NULL)) OR (family IS NOT NULL)) OR (genus IS NOT NULL)) OR (otherranks IS NOT NULL)))
1113 1113
);
......
1125 1125

  
1126 1126

  
1127 1127
--
1128
-- Name: COLUMN taxonconcept.concept_reference_id; Type: COMMENT; Schema: public; Owner: -
1129
--
1130

  
1131
COMMENT ON COLUMN taxonconcept.concept_reference_id IS 'The entity that defined the taxon concept.';
1132

  
1133

  
1134
--
1128 1135
-- Name: COLUMN taxonconcept.identifyingtaxonomicname; Type: COMMENT; Schema: public; Owner: -
1129 1136
--
1130 1137

  
......
1274 1281

  
1275 1282

  
1276 1283
--
1277
-- Name: COLUMN taxonconcept.concept_reference_id; Type: COMMENT; Schema: public; Owner: -
1278
--
1279

  
1280
COMMENT ON COLUMN taxonconcept.concept_reference_id IS 'The entity that defined the taxon concept.';
1281

  
1282

  
1283
--
1284 1284
-- Name: taxondetermination; Type: TABLE; Schema: public; Owner: -; Tablespace: 
1285 1285
--
1286 1286

  
......
4704 4704
-- Name: taxonconcept_unique_within_datasource_by_name; Type: INDEX; Schema: public; Owner: -; Tablespace: 
4705 4705
--
4706 4706

  
4707
CREATE UNIQUE INDEX taxonconcept_unique_within_datasource_by_name ON taxonconcept USING btree (datasource_id, (COALESCE(taxonomicname, '\\N'::text)), (COALESCE(author, '\\N'::text)), (COALESCE(taxonomicnamewithauthor, '\\N'::text)), (COALESCE(domain, '\\N'::text)), (COALESCE(kingdom, '\\N'::text)), (COALESCE(phylum, '\\N'::text)), (COALESCE(class, '\\N'::text)), (COALESCE("order", '\\N'::text)), (COALESCE(family, '\\N'::text)), (COALESCE(genus, '\\N'::text)), (COALESCE(species, '\\N'::text)), (COALESCE(subspecies, '\\N'::text)), (COALESCE(variety, '\\N'::text)), (COALESCE(forma, '\\N'::text)), (COALESCE(cultivar, '\\N'::text)), (COALESCE(morphospecies, '\\N'::text)), (COALESCE(otherranks, ARRAY[]::rankedtaxonname[])), (COALESCE(concept_reference_id, 2147483647))) WHERE (identifyingtaxonomicname IS NULL);
4707
CREATE UNIQUE INDEX taxonconcept_unique_within_datasource_by_name ON taxonconcept USING btree (datasource_id, (COALESCE(concept_reference_id, 2147483647)), (COALESCE(taxonomicname, '\\N'::text)), (COALESCE(author, '\\N'::text)), (COALESCE(taxonomicnamewithauthor, '\\N'::text)), (COALESCE(domain, '\\N'::text)), (COALESCE(kingdom, '\\N'::text)), (COALESCE(phylum, '\\N'::text)), (COALESCE(class, '\\N'::text)), (COALESCE("order", '\\N'::text)), (COALESCE(family, '\\N'::text)), (COALESCE(genus, '\\N'::text)), (COALESCE(species, '\\N'::text)), (COALESCE(subspecies, '\\N'::text)), (COALESCE(variety, '\\N'::text)), (COALESCE(forma, '\\N'::text)), (COALESCE(cultivar, '\\N'::text)), (COALESCE(morphospecies, '\\N'::text)), (COALESCE(otherranks, ARRAY[]::rankedtaxonname[]))) WHERE (identifyingtaxonomicname IS NULL);
4708 4708

  
4709 4709

  
4710 4710
--

Also available in: Unified diff