Revision 6414
Added by Aaron Marcuse-Kubitza about 12 years ago
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
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.