Revision 586
Added by Aaron Marcuse-Kubitza almost 13 years ago
vegbien.sql | ||
---|---|---|
88 | 88 |
emb_aggregateoccurrence integer, |
89 | 89 |
covercode character varying(10), |
90 | 90 |
count integer NOT NULL, |
91 |
accessioncode character varying(255) |
|
91 |
accessioncode character varying(255), |
|
92 |
sourceaccessioncode character varying(100) |
|
92 | 93 |
); |
93 | 94 |
|
94 | 95 |
|
... | ... | |
1066 | 1067 |
emb_individualplant integer, |
1067 | 1068 |
authorplantcode character varying(20), |
1068 | 1069 |
accessioncode character varying(255), |
1069 |
stemcount integer |
|
1070 |
stemcount integer, |
|
1071 |
sourceaccessioncode character varying(100) |
|
1070 | 1072 |
); |
1071 | 1073 |
|
1072 | 1074 |
|
... | ... | |
1300 | 1302 |
toptaxon4name character varying(255), |
1301 | 1303 |
toptaxon5name character varying(255), |
1302 | 1304 |
numberoftaxa integer, |
1303 |
accessioncode character varying(255) |
|
1305 |
accessioncode character varying(255), |
|
1306 |
sourceaccessioncode character varying(100) |
|
1304 | 1307 |
); |
1305 | 1308 |
|
1306 | 1309 |
|
... | ... | |
2268 | 2271 |
collectiondate timestamp with time zone, |
2269 | 2272 |
collector_id integer, |
2270 | 2273 |
museum_id integer, |
2271 |
sourceaccessionnumber character varying(100),
|
|
2274 |
sourceaccessioncode character varying(100),
|
|
2272 | 2275 |
accessioncode character varying(255), |
2273 | 2276 |
taxonoccurrence_id integer NOT NULL, |
2274 | 2277 |
collectornumber_dwc character varying(255) |
... | ... | |
2320 | 2323 |
heightaccuracy double precision, |
2321 | 2324 |
age double precision, |
2322 | 2325 |
accessioncode character varying(255), |
2323 |
diameteraccuracy double precision |
|
2326 |
diameteraccuracy double precision, |
|
2327 |
sourceaccessioncode character varying(100) |
|
2324 | 2328 |
); |
2325 | 2329 |
|
2326 | 2330 |
|
... | ... | |
3770 | 3774 |
|
3771 | 3775 |
|
3772 | 3776 |
-- |
3773 |
-- Name: aggregateoccurrence_keys; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: |
|
3777 |
-- Name: aggregateoccurrence_keys_accessioncode; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
|
|
3774 | 3778 |
-- |
3775 | 3779 |
|
3776 | 3780 |
ALTER TABLE ONLY aggregateoccurrence |
3777 |
ADD CONSTRAINT aggregateoccurrence_keys UNIQUE (taxonoccurrence_id, taxonbinmethod_id);
|
|
3781 |
ADD CONSTRAINT aggregateoccurrence_keys_accessioncode UNIQUE (taxonoccurrence_id, sourceaccessioncode);
|
|
3778 | 3782 |
|
3779 | 3783 |
|
3780 | 3784 |
-- |
3785 |
-- Name: aggregateoccurrence_keys_method; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: |
|
3786 |
-- |
|
3787 |
|
|
3788 |
ALTER TABLE ONLY aggregateoccurrence |
|
3789 |
ADD CONSTRAINT aggregateoccurrence_keys_method UNIQUE (taxonoccurrence_id, taxonbinmethod_id); |
|
3790 |
|
|
3791 |
|
|
3792 |
-- |
|
3781 | 3793 |
-- Name: aggregateoccurrence_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: |
3782 | 3794 |
-- |
3783 | 3795 |
|
... | ... | |
4034 | 4046 |
|
4035 | 4047 |
|
4036 | 4048 |
-- |
4037 |
-- Name: individualplant_keys; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: |
|
4049 |
-- Name: individualplant_keys_accessioncode; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
|
|
4038 | 4050 |
-- |
4039 | 4051 |
|
4040 | 4052 |
ALTER TABLE ONLY individualplant |
4041 |
ADD CONSTRAINT individualplant_keys UNIQUE (aggregateoccurrence_id, authorplantcode);
|
|
4053 |
ADD CONSTRAINT individualplant_keys_accessioncode UNIQUE (aggregateoccurrence_id, sourceaccessioncode);
|
|
4042 | 4054 |
|
4043 | 4055 |
|
4044 | 4056 |
-- |
4057 |
-- Name: individualplant_keys_code; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: |
|
4058 |
-- |
|
4059 |
|
|
4060 |
ALTER TABLE ONLY individualplant |
|
4061 |
ADD CONSTRAINT individualplant_keys_code UNIQUE (aggregateoccurrence_id, authorplantcode); |
|
4062 |
|
|
4063 |
|
|
4064 |
-- |
|
4045 | 4065 |
-- Name: individualplant_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: |
4046 | 4066 |
-- |
4047 | 4067 |
|
... | ... | |
4090 | 4110 |
|
4091 | 4111 |
|
4092 | 4112 |
-- |
4093 |
-- Name: locationevent_keys; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: |
|
4113 |
-- Name: locationevent_keys_accessioncode; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
|
|
4094 | 4114 |
-- |
4095 | 4115 |
|
4096 | 4116 |
ALTER TABLE ONLY locationevent |
4097 |
ADD CONSTRAINT locationevent_keys UNIQUE (location_id, project_id, authoreventcode);
|
|
4117 |
ADD CONSTRAINT locationevent_keys_accessioncode UNIQUE (location_id, project_id, sourceaccessioncode);
|
|
4098 | 4118 |
|
4099 | 4119 |
|
4100 | 4120 |
-- |
4121 |
-- Name: locationevent_keys_code; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: |
|
4122 |
-- |
|
4123 |
|
|
4124 |
ALTER TABLE ONLY locationevent |
|
4125 |
ADD CONSTRAINT locationevent_keys_code UNIQUE (location_id, project_id, authoreventcode); |
|
4126 |
|
|
4127 |
|
|
4128 |
-- |
|
4101 | 4129 |
-- Name: locationevent_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: |
4102 | 4130 |
-- |
4103 | 4131 |
|
... | ... | |
4354 | 4382 |
|
4355 | 4383 |
|
4356 | 4384 |
-- |
4357 |
-- Name: specimen_keys; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: |
|
4385 |
-- Name: specimen_keys_accessioncode; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
|
|
4358 | 4386 |
-- |
4359 | 4387 |
|
4360 | 4388 |
ALTER TABLE ONLY specimen |
4361 |
ADD CONSTRAINT specimen_keys UNIQUE (reference_id, collectioncode_dwc, catalognumber_dwc);
|
|
4389 |
ADD CONSTRAINT specimen_keys_accessioncode UNIQUE (reference_id, collectioncode_dwc, sourceaccessioncode);
|
|
4362 | 4390 |
|
4363 | 4391 |
|
4364 | 4392 |
-- |
4393 |
-- Name: specimen_keys_catalognumber; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: |
|
4394 |
-- |
|
4395 |
|
|
4396 |
ALTER TABLE ONLY specimen |
|
4397 |
ADD CONSTRAINT specimen_keys_catalognumber UNIQUE (reference_id, collectioncode_dwc, catalognumber_dwc); |
|
4398 |
|
|
4399 |
|
|
4400 |
-- |
|
4365 | 4401 |
-- Name: specimen_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: |
4366 | 4402 |
-- |
4367 | 4403 |
|
... | ... | |
4370 | 4406 |
|
4371 | 4407 |
|
4372 | 4408 |
-- |
4373 |
-- Name: stem_keys; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: |
|
4409 |
-- Name: stem_keys_accessioncode; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
|
|
4374 | 4410 |
-- |
4375 | 4411 |
|
4376 | 4412 |
ALTER TABLE ONLY stem |
4377 |
ADD CONSTRAINT stem_keys UNIQUE (individualplant_id, authorstemcode);
|
|
4413 |
ADD CONSTRAINT stem_keys_accessioncode UNIQUE (individualplant_id, sourceaccessioncode);
|
|
4378 | 4414 |
|
4379 | 4415 |
|
4380 | 4416 |
-- |
4417 |
-- Name: stem_keys_code; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: |
|
4418 |
-- |
|
4419 |
|
|
4420 |
ALTER TABLE ONLY stem |
|
4421 |
ADD CONSTRAINT stem_keys_code UNIQUE (individualplant_id, authorstemcode); |
|
4422 |
|
|
4423 |
|
|
4424 |
-- |
|
4381 | 4425 |
-- Name: stem_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: |
4382 | 4426 |
-- |
4383 | 4427 |
|
Also available in: Unified diff
VegBIEN: Renamed sourceaccessionnumber to sourceaccessioncode to show that they are the data source's analog of accessioncode. Added sourceaccessioncode to all applicable tables because this is the database pkey, which is distinct from any author*code applied by the collector.