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:

schemas/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

  
schemas/vegbien.sql
1335 1335
--
1336 1336

  
1337 1337
CREATE TABLE analytical_aggregate (
1338
    "institutionCode" text,
1338
    "institutionCode" text NOT NULL,
1339 1339
    country text,
1340 1340
    "stateProvince" text,
1341 1341
    county text,
......
1346 1346
    "isNewWorld" boolean,
1347 1347
    "distanceToCountry_km" double precision,
1348 1348
    "distanceToStateProvince_km" double precision,
1349
    "plotName" text,
1349
    "plotName" text NOT NULL,
1350 1350
    "elevationInMeters" double precision,
1351 1351
    "plotArea_ha" double precision,
1352 1352
    "samplingProtocol" text,
......
1357 1357
    "speciesBinomial" text,
1358 1358
    "scientificName" text,
1359 1359
    "scientificNameAuthorship" text,
1360
    "scientificNameWithMorphospecies" text,
1360
    "scientificNameWithMorphospecies" text NOT NULL,
1361 1361
    threatened boolean,
1362 1362
    "growthForm" growthform,
1363 1363
    cultivated boolean,
......
5164 5164

  
5165 5165

  
5166 5166
--
5167
-- Name: analytical_aggregate_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: 
5168
--
5169

  
5170
ALTER TABLE ONLY analytical_aggregate
5171
    ADD CONSTRAINT analytical_aggregate_pkey PRIMARY KEY ("institutionCode", "plotName", "scientificNameWithMorphospecies");
5172

  
5173

  
5174
--
5167 5175
-- Name: classcontributor_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: 
5168 5176
--
5169 5177

  

Also available in: Unified diff