Revision 6417
Added by Aaron Marcuse-Kubitza over 11 years ago
vegbien.sql | ||
---|---|---|
1375 | 1375 |
-- |
1376 | 1376 |
|
1377 | 1377 |
CREATE TABLE analytical_stem ( |
1378 |
"institutionCode" text, |
|
1378 |
"institutionCode" text NOT NULL,
|
|
1379 | 1379 |
country text, |
1380 | 1380 |
"stateProvince" text, |
1381 | 1381 |
county text, |
... | ... | |
1386 | 1386 |
"isNewWorld" boolean, |
1387 | 1387 |
"distanceToCountry_km" double precision, |
1388 | 1388 |
"distanceToStateProvince_km" double precision, |
1389 |
"plotName" text, |
|
1389 |
"plotName" text NOT NULL,
|
|
1390 | 1390 |
"elevationInMeters" double precision, |
1391 | 1391 |
"plotArea_ha" double precision, |
1392 | 1392 |
"samplingProtocol" text, |
... | ... | |
1397 | 1397 |
"speciesBinomial" text, |
1398 | 1398 |
"scientificName" text, |
1399 | 1399 |
"scientificNameAuthorship" text, |
1400 |
"scientificNameWithMorphospecies" text, |
|
1400 |
"scientificNameWithMorphospecies" text NOT NULL,
|
|
1401 | 1401 |
threatened boolean, |
1402 | 1402 |
"identifiedBy" text, |
1403 | 1403 |
"growthForm" growthform, |
... | ... | |
1410 | 1410 |
"organismX_m" double precision, |
1411 | 1411 |
"organismY_m" double precision, |
1412 | 1412 |
"recordedBy" text, |
1413 |
"recordNumber" text |
|
1413 |
"recordNumber" text NOT NULL
|
|
1414 | 1414 |
); |
1415 | 1415 |
|
1416 | 1416 |
|
... | ... | |
5172 | 5172 |
|
5173 | 5173 |
|
5174 | 5174 |
-- |
5175 |
-- Name: analytical_stem_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: |
|
5176 |
-- |
|
5177 |
|
|
5178 |
ALTER TABLE ONLY analytical_stem |
|
5179 |
ADD CONSTRAINT analytical_stem_pkey PRIMARY KEY ("institutionCode", "plotName", "scientificNameWithMorphospecies", "recordNumber"); |
|
5180 |
|
|
5181 |
|
|
5182 |
-- |
|
5175 | 5183 |
-- Name: classcontributor_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: |
5176 | 5184 |
-- |
5177 | 5185 |
|
Also available in: Unified diff
schemas/vegbien.sql: analytical_aggregate: Added primary key on institutionCode, plotName, scientificNameWithMorphospecies, recordNumber. Note that this makes these fields NOT NULL, which should not be a problem because there are inner joins instead of LEFT JOINs on most of the tables which provide them, and LEFT JOINed tables have their identifying fields combined to create a NOT NULL value.