Revision 6417
Added by Aaron Marcuse-Kubitza over 11 years ago
vegbien.my.sql | ||
---|---|---|
707 | 707 |
-- |
708 | 708 |
|
709 | 709 |
CREATE TABLE analytical_stem ( |
710 |
`institutionCode` text, |
|
710 |
`institutionCode` text NOT NULL,
|
|
711 | 711 |
country text, |
712 | 712 |
`stateProvince` text, |
713 | 713 |
county text, |
... | ... | |
718 | 718 |
`isNewWorld` int(1), |
719 | 719 |
`distanceToCountry_km` double precision, |
720 | 720 |
`distanceToStateProvince_km` double precision, |
721 |
`plotName` text, |
|
721 |
`plotName` text NOT NULL,
|
|
722 | 722 |
`elevationInMeters` double precision, |
723 | 723 |
`plotArea_ha` double precision, |
724 | 724 |
`samplingProtocol` text, |
... | ... | |
729 | 729 |
`speciesBinomial` text, |
730 | 730 |
`scientificName` text, |
731 | 731 |
`scientificNameAuthorship` text, |
732 |
`scientificNameWithMorphospecies` text, |
|
732 |
`scientificNameWithMorphospecies` text NOT NULL,
|
|
733 | 733 |
threatened int(1), |
734 | 734 |
`identifiedBy` text, |
735 | 735 |
`growthForm` text, |
... | ... | |
742 | 742 |
`organismX_m` double precision, |
743 | 743 |
`organismY_m` double precision, |
744 | 744 |
`recordedBy` text, |
745 |
`recordNumber` text |
|
745 |
`recordNumber` text NOT NULL
|
|
746 | 746 |
); |
747 | 747 |
|
748 | 748 |
|
... | ... | |
4175 | 4175 |
|
4176 | 4176 |
|
4177 | 4177 |
-- |
4178 |
-- Name: analytical_stem_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: |
|
4179 |
-- |
|
4180 |
|
|
4181 |
ALTER TABLE analytical_stem |
|
4182 |
ADD CONSTRAINT analytical_stem_pkey PRIMARY KEY (`institutionCode`, `plotName`, `scientificNameWithMorphospecies`, `recordNumber`); |
|
4183 |
|
|
4184 |
|
|
4185 |
-- |
|
4178 | 4186 |
-- Name: classcontributor_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: |
4179 | 4187 |
-- |
4180 | 4188 |
|
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.