Project

General

Profile

« Previous | Next » 

Revision 6414

schemas/vegbien.sql: analytical_aggregate: Added primary key on institutionCode, plotName, scientificNameWithMorphospecies. Note that this makes these fields NOT NULL, which should not be a problem because there are inner joins instead of LEFT JOINs on the tables which provide them.

View differences:

vegbien.my.sql
667 667
--
668 668

  
669 669
CREATE TABLE analytical_aggregate (
670
    `institutionCode` text,
670
    `institutionCode` text NOT NULL,
671 671
    country text,
672 672
    `stateProvince` text,
673 673
    county text,
......
678 678
    `isNewWorld` int(1),
679 679
    `distanceToCountry_km` double precision,
680 680
    `distanceToStateProvince_km` double precision,
681
    `plotName` text,
681
    `plotName` text NOT NULL,
682 682
    `elevationInMeters` double precision,
683 683
    `plotArea_ha` double precision,
684 684
    `samplingProtocol` text,
......
689 689
    `speciesBinomial` text,
690 690
    `scientificName` text,
691 691
    `scientificNameAuthorship` text,
692
    `scientificNameWithMorphospecies` text,
692
    `scientificNameWithMorphospecies` text NOT NULL,
693 693
    threatened int(1),
694 694
    `growthForm` text,
695 695
    cultivated int(1),
......
4166 4166

  
4167 4167

  
4168 4168
--
4169
-- Name: analytical_aggregate_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: 
4170
--
4171

  
4172
ALTER TABLE analytical_aggregate
4173
    ADD CONSTRAINT analytical_aggregate_pkey PRIMARY KEY (`institutionCode`, `plotName`, `scientificNameWithMorphospecies`);
4174

  
4175

  
4176
--
4169 4177
-- Name: classcontributor_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: 
4170 4178
--
4171 4179

  

Also available in: Unified diff