Revision 1113
Added by Aaron Marcuse-Kubitza almost 13 years ago
vegbien.sql | ||
---|---|---|
3272 | 3272 |
|
3273 | 3273 |
|
3274 | 3274 |
-- |
3275 |
-- Name: aggregateoccurrence_keys_accessioncode; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
|
|
3275 |
-- Name: aggregateoccurrence_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
|
|
3276 | 3276 |
-- |
3277 | 3277 |
|
3278 | 3278 |
ALTER TABLE ONLY aggregateoccurrence |
3279 |
ADD CONSTRAINT aggregateoccurrence_keys_accessioncode UNIQUE (taxonoccurrence_id, sourceaccessioncode);
|
|
3279 |
ADD CONSTRAINT aggregateoccurrence_pkey PRIMARY KEY (aggregateoccurrence_id);
|
|
3280 | 3280 |
|
3281 | 3281 |
|
3282 | 3282 |
-- |
3283 |
-- Name: aggregateoccurrence_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
|
|
3283 |
-- Name: aggregateoccurrence_unique_accessioncode; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
|
|
3284 | 3284 |
-- |
3285 | 3285 |
|
3286 | 3286 |
ALTER TABLE ONLY aggregateoccurrence |
3287 |
ADD CONSTRAINT aggregateoccurrence_pkey PRIMARY KEY (aggregateoccurrence_id);
|
|
3287 |
ADD CONSTRAINT aggregateoccurrence_unique_accessioncode UNIQUE (taxonoccurrence_id, sourceaccessioncode);
|
|
3288 | 3288 |
|
3289 | 3289 |
|
3290 | 3290 |
-- |
... | ... | |
3296 | 3296 |
|
3297 | 3297 |
|
3298 | 3298 |
-- |
3299 |
-- Name: commclass_keys; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
|
|
3299 |
-- Name: commclass_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
|
|
3300 | 3300 |
-- |
3301 | 3301 |
|
3302 | 3302 |
ALTER TABLE ONLY commclass |
3303 |
ADD CONSTRAINT commclass_keys UNIQUE (locationevent_id, classnotes);
|
|
3303 |
ADD CONSTRAINT commclass_pkey PRIMARY KEY (commclass_id);
|
|
3304 | 3304 |
|
3305 | 3305 |
|
3306 | 3306 |
-- |
3307 |
-- Name: commclass_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
|
|
3307 |
-- Name: commclass_unique; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
|
|
3308 | 3308 |
-- |
3309 | 3309 |
|
3310 | 3310 |
ALTER TABLE ONLY commclass |
3311 |
ADD CONSTRAINT commclass_pkey PRIMARY KEY (commclass_id);
|
|
3311 |
ADD CONSTRAINT commclass_unique UNIQUE (locationevent_id, classnotes);
|
|
3312 | 3312 |
|
3313 | 3313 |
|
3314 | 3314 |
-- |
3315 |
-- Name: commconcept_keys; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
|
|
3315 |
-- Name: commconcept_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
|
|
3316 | 3316 |
-- |
3317 | 3317 |
|
3318 | 3318 |
ALTER TABLE ONLY commconcept |
3319 |
ADD CONSTRAINT commconcept_keys UNIQUE (commname_id);
|
|
3319 |
ADD CONSTRAINT commconcept_pkey PRIMARY KEY (commconcept_id);
|
|
3320 | 3320 |
|
3321 | 3321 |
|
3322 | 3322 |
-- |
3323 |
-- Name: commconcept_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
|
|
3323 |
-- Name: commconcept_unique; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
|
|
3324 | 3324 |
-- |
3325 | 3325 |
|
3326 | 3326 |
ALTER TABLE ONLY commconcept |
3327 |
ADD CONSTRAINT commconcept_pkey PRIMARY KEY (commconcept_id);
|
|
3327 |
ADD CONSTRAINT commconcept_unique UNIQUE (commname_id);
|
|
3328 | 3328 |
|
3329 | 3329 |
|
3330 | 3330 |
-- |
... | ... | |
3336 | 3336 |
|
3337 | 3337 |
|
3338 | 3338 |
-- |
3339 |
-- Name: commdetermination_keys; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
|
|
3339 |
-- Name: commdetermination_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
|
|
3340 | 3340 |
-- |
3341 | 3341 |
|
3342 | 3342 |
ALTER TABLE ONLY commdetermination |
3343 |
ADD CONSTRAINT commdetermination_keys UNIQUE (commclass_id, commconcept_id);
|
|
3343 |
ADD CONSTRAINT commdetermination_pkey PRIMARY KEY (commdetermination_id);
|
|
3344 | 3344 |
|
3345 | 3345 |
|
3346 | 3346 |
-- |
3347 |
-- Name: commdetermination_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
|
|
3347 |
-- Name: commdetermination_unique; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
|
|
3348 | 3348 |
-- |
3349 | 3349 |
|
3350 | 3350 |
ALTER TABLE ONLY commdetermination |
3351 |
ADD CONSTRAINT commdetermination_pkey PRIMARY KEY (commdetermination_id);
|
|
3351 |
ADD CONSTRAINT commdetermination_unique UNIQUE (commclass_id, commconcept_id);
|
|
3352 | 3352 |
|
3353 | 3353 |
|
3354 | 3354 |
-- |
... | ... | |
3360 | 3360 |
|
3361 | 3361 |
|
3362 | 3362 |
-- |
3363 |
-- Name: commname_keys; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
|
|
3363 |
-- Name: commname_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
|
|
3364 | 3364 |
-- |
3365 | 3365 |
|
3366 | 3366 |
ALTER TABLE ONLY commname |
3367 |
ADD CONSTRAINT commname_keys UNIQUE (commname);
|
|
3367 |
ADD CONSTRAINT commname_pkey PRIMARY KEY (commname_id);
|
|
3368 | 3368 |
|
3369 | 3369 |
|
3370 | 3370 |
-- |
3371 |
-- Name: commname_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
|
|
3371 |
-- Name: commname_unique; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
|
|
3372 | 3372 |
-- |
3373 | 3373 |
|
3374 | 3374 |
ALTER TABLE ONLY commname |
3375 |
ADD CONSTRAINT commname_pkey PRIMARY KEY (commname_id);
|
|
3375 |
ADD CONSTRAINT commname_unique UNIQUE (commname);
|
|
3376 | 3376 |
|
3377 | 3377 |
|
3378 | 3378 |
-- |
... | ... | |
3440 | 3440 |
|
3441 | 3441 |
|
3442 | 3442 |
-- |
3443 |
-- Name: growthform_keys; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
|
|
3443 |
-- Name: growthform_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
|
|
3444 | 3444 |
-- |
3445 | 3445 |
|
3446 | 3446 |
ALTER TABLE ONLY growthform |
3447 |
ADD CONSTRAINT growthform_keys UNIQUE (name);
|
|
3447 |
ADD CONSTRAINT growthform_pkey PRIMARY KEY (growthform_id);
|
|
3448 | 3448 |
|
3449 | 3449 |
|
3450 | 3450 |
-- |
3451 |
-- Name: growthform_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
|
|
3451 |
-- Name: growthform_unique; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
|
|
3452 | 3452 |
-- |
3453 | 3453 |
|
3454 | 3454 |
ALTER TABLE ONLY growthform |
3455 |
ADD CONSTRAINT growthform_pkey PRIMARY KEY (growthform_id);
|
|
3455 |
ADD CONSTRAINT growthform_unique UNIQUE (name);
|
|
3456 | 3456 |
|
3457 | 3457 |
|
3458 | 3458 |
-- |
3459 |
-- Name: location_keys_coords; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
|
|
3459 |
-- Name: location_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
|
|
3460 | 3460 |
-- |
3461 | 3461 |
|
3462 | 3462 |
ALTER TABLE ONLY location |
3463 |
ADD CONSTRAINT location_keys_coords UNIQUE (centerlatitude, centerlongitude);
|
|
3463 |
ADD CONSTRAINT location_pkey PRIMARY KEY (location_id);
|
|
3464 | 3464 |
|
3465 | 3465 |
|
3466 | 3466 |
-- |
3467 |
-- Name: location_keys_subplot_coords; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
|
|
3467 |
-- Name: location_unique_coords; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
|
|
3468 | 3468 |
-- |
3469 | 3469 |
|
3470 | 3470 |
ALTER TABLE ONLY location |
3471 |
ADD CONSTRAINT location_keys_subplot_coords UNIQUE (parent_id, sublocationxposition, sublocationyposition);
|
|
3471 |
ADD CONSTRAINT location_unique_coords UNIQUE (centerlatitude, centerlongitude);
|
|
3472 | 3472 |
|
3473 | 3473 |
|
3474 | 3474 |
-- |
3475 |
-- Name: location_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
|
|
3475 |
-- Name: location_unique_subplot_coords; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
|
|
3476 | 3476 |
-- |
3477 | 3477 |
|
3478 | 3478 |
ALTER TABLE ONLY location |
3479 |
ADD CONSTRAINT location_pkey PRIMARY KEY (location_id);
|
|
3479 |
ADD CONSTRAINT location_unique_subplot_coords UNIQUE (parent_id, sublocationxposition, sublocationyposition);
|
|
3480 | 3480 |
|
3481 | 3481 |
|
3482 | 3482 |
-- |
3483 |
-- Name: locationdetermination_keys; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
|
|
3483 |
-- Name: locationdetermination_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
|
|
3484 | 3484 |
-- |
3485 | 3485 |
|
3486 | 3486 |
ALTER TABLE ONLY locationdetermination |
3487 |
ADD CONSTRAINT locationdetermination_keys UNIQUE (location_id, namedplace_id);
|
|
3487 |
ADD CONSTRAINT locationdetermination_pkey PRIMARY KEY (locationdetermination_id);
|
|
3488 | 3488 |
|
3489 | 3489 |
|
3490 | 3490 |
-- |
3491 |
-- Name: locationdetermination_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
|
|
3491 |
-- Name: locationdetermination_unique; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
|
|
3492 | 3492 |
-- |
3493 | 3493 |
|
3494 | 3494 |
ALTER TABLE ONLY locationdetermination |
3495 |
ADD CONSTRAINT locationdetermination_pkey PRIMARY KEY (locationdetermination_id);
|
|
3495 |
ADD CONSTRAINT locationdetermination_unique UNIQUE (location_id, namedplace_id);
|
|
3496 | 3496 |
|
3497 | 3497 |
|
3498 | 3498 |
-- |
3499 |
-- Name: locationevent_keys_datasource_accessioncode; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
|
|
3499 |
-- Name: locationevent_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
|
|
3500 | 3500 |
-- |
3501 | 3501 |
|
3502 | 3502 |
ALTER TABLE ONLY locationevent |
3503 |
ADD CONSTRAINT locationevent_keys_datasource_accessioncode UNIQUE (datasource_id, sourceaccessioncode);
|
|
3503 |
ADD CONSTRAINT locationevent_pkey PRIMARY KEY (locationevent_id);
|
|
3504 | 3504 |
|
3505 | 3505 |
|
3506 | 3506 |
-- |
3507 |
-- Name: locationevent_keys_parent_authorcode; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
|
|
3507 |
-- Name: locationevent_unique_datasource_accessioncode; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
|
|
3508 | 3508 |
-- |
3509 | 3509 |
|
3510 | 3510 |
ALTER TABLE ONLY locationevent |
3511 |
ADD CONSTRAINT locationevent_keys_parent_authorcode UNIQUE (parent_id, authorlocationcode);
|
|
3511 |
ADD CONSTRAINT locationevent_unique_datasource_accessioncode UNIQUE (datasource_id, sourceaccessioncode);
|
|
3512 | 3512 |
|
3513 | 3513 |
|
3514 | 3514 |
-- |
3515 |
-- Name: locationevent_keys_parent_location; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
|
|
3515 |
-- Name: locationevent_unique_parent_authorcode; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
|
|
3516 | 3516 |
-- |
3517 | 3517 |
|
3518 | 3518 |
ALTER TABLE ONLY locationevent |
3519 |
ADD CONSTRAINT locationevent_keys_parent_location UNIQUE (parent_id, location_id);
|
|
3519 |
ADD CONSTRAINT locationevent_unique_parent_authorcode UNIQUE (parent_id, authorlocationcode);
|
|
3520 | 3520 |
|
3521 | 3521 |
|
3522 | 3522 |
-- |
3523 |
-- Name: locationevent_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
|
|
3523 |
-- Name: locationevent_unique_parent_location; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
|
|
3524 | 3524 |
-- |
3525 | 3525 |
|
3526 | 3526 |
ALTER TABLE ONLY locationevent |
3527 |
ADD CONSTRAINT locationevent_pkey PRIMARY KEY (locationevent_id);
|
|
3527 |
ADD CONSTRAINT locationevent_unique_parent_location UNIQUE (parent_id, location_id);
|
|
3528 | 3528 |
|
3529 | 3529 |
|
3530 | 3530 |
-- |
... | ... | |
3568 | 3568 |
|
3569 | 3569 |
|
3570 | 3570 |
-- |
3571 |
-- Name: namedplace_keys; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
|
|
3571 |
-- Name: namedplace_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
|
|
3572 | 3572 |
-- |
3573 | 3573 |
|
3574 | 3574 |
ALTER TABLE ONLY namedplace |
3575 |
ADD CONSTRAINT namedplace_keys UNIQUE (placesystem, placename);
|
|
3575 |
ADD CONSTRAINT namedplace_pkey PRIMARY KEY (namedplace_id);
|
|
3576 | 3576 |
|
3577 | 3577 |
|
3578 | 3578 |
-- |
3579 |
-- Name: namedplace_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
|
|
3579 |
-- Name: namedplace_unique; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
|
|
3580 | 3580 |
-- |
3581 | 3581 |
|
3582 | 3582 |
ALTER TABLE ONLY namedplace |
3583 |
ADD CONSTRAINT namedplace_pkey PRIMARY KEY (namedplace_id);
|
|
3583 |
ADD CONSTRAINT namedplace_unique UNIQUE (placesystem, placename);
|
|
3584 | 3584 |
|
3585 | 3585 |
|
3586 | 3586 |
-- |
... | ... | |
3680 | 3680 |
|
3681 | 3681 |
|
3682 | 3682 |
-- |
3683 |
-- Name: plantstatus_keys; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
|
|
3683 |
-- Name: plantstatus_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
|
|
3684 | 3684 |
-- |
3685 | 3685 |
|
3686 | 3686 |
ALTER TABLE ONLY plantstatus |
3687 |
ADD CONSTRAINT plantstatus_keys UNIQUE (plantconcept_id, party_id);
|
|
3687 |
ADD CONSTRAINT plantstatus_pkey PRIMARY KEY (plantstatus_id);
|
|
3688 | 3688 |
|
3689 | 3689 |
|
3690 | 3690 |
-- |
3691 |
-- Name: plantstatus_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
|
|
3691 |
-- Name: plantstatus_unique; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
|
|
3692 | 3692 |
-- |
3693 | 3693 |
|
3694 | 3694 |
ALTER TABLE ONLY plantstatus |
3695 |
ADD CONSTRAINT plantstatus_pkey PRIMARY KEY (plantstatus_id);
|
|
3695 |
ADD CONSTRAINT plantstatus_unique UNIQUE (plantconcept_id, party_id);
|
|
3696 | 3696 |
|
3697 | 3697 |
|
3698 | 3698 |
-- |
... | ... | |
3704 | 3704 |
|
3705 | 3705 |
|
3706 | 3706 |
-- |
3707 |
-- Name: project_keys; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
|
|
3707 |
-- Name: project_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
|
|
3708 | 3708 |
-- |
3709 | 3709 |
|
3710 | 3710 |
ALTER TABLE ONLY project |
3711 |
ADD CONSTRAINT project_keys UNIQUE (datasource_id, projectname);
|
|
3711 |
ADD CONSTRAINT project_pkey PRIMARY KEY (project_id);
|
|
3712 | 3712 |
|
3713 | 3713 |
|
3714 | 3714 |
-- |
3715 |
-- Name: project_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
|
|
3715 |
-- Name: project_unique; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
|
|
3716 | 3716 |
-- |
3717 | 3717 |
|
3718 | 3718 |
ALTER TABLE ONLY project |
3719 |
ADD CONSTRAINT project_pkey PRIMARY KEY (project_id);
|
|
3719 |
ADD CONSTRAINT project_unique UNIQUE (datasource_id, projectname);
|
|
3720 | 3720 |
|
3721 | 3721 |
|
3722 | 3722 |
-- |
... | ... | |
3784 | 3784 |
|
3785 | 3785 |
|
3786 | 3786 |
-- |
3787 |
-- Name: soilobs_keys; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
|
|
3787 |
-- Name: soilobs_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
|
|
3788 | 3788 |
-- |
3789 | 3789 |
|
3790 | 3790 |
ALTER TABLE ONLY soilobs |
3791 |
ADD CONSTRAINT soilobs_keys UNIQUE (locationevent_id);
|
|
3791 |
ADD CONSTRAINT soilobs_pkey PRIMARY KEY (soilobs_id);
|
|
3792 | 3792 |
|
3793 | 3793 |
|
3794 | 3794 |
-- |
3795 |
-- Name: soilobs_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
|
|
3795 |
-- Name: soilobs_unique; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
|
|
3796 | 3796 |
-- |
3797 | 3797 |
|
3798 | 3798 |
ALTER TABLE ONLY soilobs |
3799 |
ADD CONSTRAINT soilobs_pkey PRIMARY KEY (soilobs_id);
|
|
3799 |
ADD CONSTRAINT soilobs_unique UNIQUE (locationevent_id);
|
|
3800 | 3800 |
|
3801 | 3801 |
|
3802 | 3802 |
-- |
... | ... | |
3816 | 3816 |
|
3817 | 3817 |
|
3818 | 3818 |
-- |
3819 |
-- Name: specimenreplicate_keys_accessioncode; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
|
|
3819 |
-- Name: specimenreplicate_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
|
|
3820 | 3820 |
-- |
3821 | 3821 |
|
3822 | 3822 |
ALTER TABLE ONLY specimenreplicate |
3823 |
ADD CONSTRAINT specimenreplicate_keys_accessioncode UNIQUE (datasource_id, sourceaccessioncode);
|
|
3823 |
ADD CONSTRAINT specimenreplicate_pkey PRIMARY KEY (specimenreplicate_id);
|
|
3824 | 3824 |
|
3825 | 3825 |
|
3826 | 3826 |
-- |
3827 |
-- Name: specimenreplicate_keys_catalognumber; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
|
|
3827 |
-- Name: specimenreplicate_unique_accessioncode; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
|
|
3828 | 3828 |
-- |
3829 | 3829 |
|
3830 | 3830 |
ALTER TABLE ONLY specimenreplicate |
3831 |
ADD CONSTRAINT specimenreplicate_keys_catalognumber UNIQUE (datasource_id, collectioncode_dwc, catalognumber_dwc);
|
|
3831 |
ADD CONSTRAINT specimenreplicate_unique_accessioncode UNIQUE (datasource_id, sourceaccessioncode);
|
|
3832 | 3832 |
|
3833 | 3833 |
|
3834 | 3834 |
-- |
3835 |
-- Name: specimenreplicate_keys_collectionnumber; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
|
|
3835 |
-- Name: specimenreplicate_unique_catalognumber; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
|
|
3836 | 3836 |
-- |
3837 | 3837 |
|
3838 | 3838 |
ALTER TABLE ONLY specimenreplicate |
3839 |
ADD CONSTRAINT specimenreplicate_keys_collectionnumber UNIQUE (datasource_id, collectionnumber);
|
|
3839 |
ADD CONSTRAINT specimenreplicate_unique_catalognumber UNIQUE (datasource_id, collectioncode_dwc, catalognumber_dwc);
|
|
3840 | 3840 |
|
3841 | 3841 |
|
3842 | 3842 |
-- |
3843 |
-- Name: specimenreplicate_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
|
|
3843 |
-- Name: specimenreplicate_unique_collectionnumber; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
|
|
3844 | 3844 |
-- |
3845 | 3845 |
|
3846 | 3846 |
ALTER TABLE ONLY specimenreplicate |
3847 |
ADD CONSTRAINT specimenreplicate_pkey PRIMARY KEY (specimenreplicate_id);
|
|
3847 |
ADD CONSTRAINT specimenreplicate_unique_collectionnumber UNIQUE (datasource_id, collectionnumber);
|
|
3848 | 3848 |
|
3849 | 3849 |
|
3850 | 3850 |
-- |
3851 |
-- Name: stemobservation_keys_accessioncode; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
|
|
3851 |
-- Name: stemobservation_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
|
|
3852 | 3852 |
-- |
3853 | 3853 |
|
3854 | 3854 |
ALTER TABLE ONLY stemobservation |
3855 |
ADD CONSTRAINT stemobservation_keys_accessioncode UNIQUE (plantobservation_id, sourceaccessioncode);
|
|
3855 |
ADD CONSTRAINT stemobservation_pkey PRIMARY KEY (stemobservation_id);
|
|
3856 | 3856 |
|
3857 | 3857 |
|
3858 | 3858 |
-- |
3859 |
-- Name: stemobservation_keys_code; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
|
|
3859 |
-- Name: stemobservation_unique_accessioncode; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
|
|
3860 | 3860 |
-- |
3861 | 3861 |
|
3862 | 3862 |
ALTER TABLE ONLY stemobservation |
3863 |
ADD CONSTRAINT stemobservation_keys_code UNIQUE (plantobservation_id, authorstemcode);
|
|
3863 |
ADD CONSTRAINT stemobservation_unique_accessioncode UNIQUE (plantobservation_id, sourceaccessioncode);
|
|
3864 | 3864 |
|
3865 | 3865 |
|
3866 | 3866 |
-- |
3867 |
-- Name: stemobservation_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
|
|
3867 |
-- Name: stemobservation_unique_code; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
|
|
3868 | 3868 |
-- |
3869 | 3869 |
|
3870 | 3870 |
ALTER TABLE ONLY stemobservation |
3871 |
ADD CONSTRAINT stemobservation_pkey PRIMARY KEY (stemobservation_id);
|
|
3871 |
ADD CONSTRAINT stemobservation_unique_code UNIQUE (plantobservation_id, authorstemcode);
|
|
3872 | 3872 |
|
3873 | 3873 |
|
3874 | 3874 |
-- |
... | ... | |
3880 | 3880 |
|
3881 | 3881 |
|
3882 | 3882 |
-- |
3883 |
-- Name: stemtag_keys; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
|
|
3883 |
-- Name: stemtag_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
|
|
3884 | 3884 |
-- |
3885 | 3885 |
|
3886 | 3886 |
ALTER TABLE ONLY stemtag |
3887 |
ADD CONSTRAINT stemtag_keys UNIQUE (stemobservation_id, tag);
|
|
3887 |
ADD CONSTRAINT stemtag_pkey PRIMARY KEY (stemtag_id);
|
|
3888 | 3888 |
|
3889 | 3889 |
|
3890 | 3890 |
-- |
3891 |
-- Name: stemtag_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
|
|
3891 |
-- Name: stemtag_unique; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
|
|
3892 | 3892 |
-- |
3893 | 3893 |
|
3894 | 3894 |
ALTER TABLE ONLY stemtag |
3895 |
ADD CONSTRAINT stemtag_pkey PRIMARY KEY (stemtag_id);
|
|
3895 |
ADD CONSTRAINT stemtag_unique UNIQUE (stemobservation_id, tag);
|
|
3896 | 3896 |
|
3897 | 3897 |
|
3898 | 3898 |
-- |
... | ... | |
3952 | 3952 |
|
3953 | 3953 |
|
3954 | 3954 |
-- |
3955 |
-- Name: voucher_keys; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
|
|
3955 |
-- Name: voucher_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
|
|
3956 | 3956 |
-- |
3957 | 3957 |
|
3958 | 3958 |
ALTER TABLE ONLY voucher |
3959 |
ADD CONSTRAINT voucher_keys UNIQUE (taxonoccurrence_id, specimenreplicate_id);
|
|
3959 |
ADD CONSTRAINT voucher_pkey PRIMARY KEY (voucher_id);
|
|
3960 | 3960 |
|
3961 | 3961 |
|
3962 | 3962 |
-- |
3963 |
-- Name: voucher_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
|
|
3963 |
-- Name: voucher_unique; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
|
|
3964 | 3964 |
-- |
3965 | 3965 |
|
3966 | 3966 |
ALTER TABLE ONLY voucher |
3967 |
ADD CONSTRAINT voucher_pkey PRIMARY KEY (voucher_id);
|
|
3967 |
ADD CONSTRAINT voucher_unique UNIQUE (taxonoccurrence_id, specimenreplicate_id);
|
|
3968 | 3968 |
|
3969 | 3969 |
|
3970 | 3970 |
-- |
... | ... | |
4556 | 4556 |
|
4557 | 4557 |
|
4558 | 4558 |
-- |
4559 |
-- Name: locationevent_keys_project_authorcode; Type: INDEX; Schema: public; Owner: -; Tablespace: |
|
4560 |
-- |
|
4561 |
|
|
4562 |
CREATE UNIQUE INDEX locationevent_keys_project_authorcode ON locationevent USING btree (project_id, authorlocationcode, obsstartdate) WHERE (parent_id IS NULL); |
|
4563 |
|
|
4564 |
|
|
4565 |
-- |
|
4566 | 4559 |
-- Name: locationevent_location_id_x; Type: INDEX; Schema: public; Owner: -; Tablespace: |
4567 | 4560 |
-- |
4568 | 4561 |
|
... | ... | |
4591 | 4584 |
|
4592 | 4585 |
|
4593 | 4586 |
-- |
4587 |
-- Name: locationevent_unique_project_authorcode; Type: INDEX; Schema: public; Owner: -; Tablespace: |
|
4588 |
-- |
|
4589 |
|
|
4590 |
CREATE UNIQUE INDEX locationevent_unique_project_authorcode ON locationevent USING btree (project_id, authorlocationcode, obsstartdate) WHERE (parent_id IS NULL); |
|
4591 |
|
|
4592 |
|
|
4593 |
-- |
|
4594 | 4594 |
-- Name: locationeventcontributor_locationevent_id_x; Type: INDEX; Schema: public; Owner: -; Tablespace: |
4595 | 4595 |
-- |
4596 | 4596 |
|
... | ... | |
4654 | 4654 |
|
4655 | 4655 |
|
4656 | 4656 |
-- |
4657 |
-- Name: method_keys; Type: INDEX; Schema: public; Owner: -; Tablespace:
|
|
4657 |
-- Name: method_unique; Type: INDEX; Schema: public; Owner: -; Tablespace:
|
|
4658 | 4658 |
-- |
4659 | 4659 |
|
4660 |
CREATE UNIQUE INDEX method_keys ON method USING btree (name, (COALESCE(description, ''::text)));
|
|
4660 |
CREATE UNIQUE INDEX method_unique ON method USING btree (name, (COALESCE(description, ''::text)));
|
|
4661 | 4661 |
|
4662 | 4662 |
|
4663 | 4663 |
-- |
... | ... | |
4724 | 4724 |
|
4725 | 4725 |
|
4726 | 4726 |
-- |
4727 |
-- Name: party_keys; Type: INDEX; Schema: public; Owner: -; Tablespace: |
|
4728 |
-- |
|
4729 |
|
|
4730 |
CREATE UNIQUE INDEX party_keys ON party USING btree ((COALESCE(givenname, ''::text)), (COALESCE(middlename, ''::text)), (COALESCE(surname, ''::text)), (COALESCE(organizationname, ''::text))); |
|
4731 |
|
|
4732 |
|
|
4733 |
-- |
|
4734 | 4727 |
-- Name: party_middlename; Type: INDEX; Schema: public; Owner: -; Tablespace: |
4735 | 4728 |
-- |
4736 | 4729 |
|
... | ... | |
4752 | 4745 |
|
4753 | 4746 |
|
4754 | 4747 |
-- |
4748 |
-- Name: party_unique; Type: INDEX; Schema: public; Owner: -; Tablespace: |
|
4749 |
-- |
|
4750 |
|
|
4751 |
CREATE UNIQUE INDEX party_unique ON party USING btree ((COALESCE(givenname, ''::text)), (COALESCE(middlename, ''::text)), (COALESCE(surname, ''::text)), (COALESCE(organizationname, ''::text))); |
|
4752 |
|
|
4753 |
|
|
4754 |
-- |
|
4755 | 4755 |
-- Name: partymember_childparty_id_x; Type: INDEX; Schema: public; Owner: -; Tablespace: |
4756 | 4756 |
-- |
4757 | 4757 |
|
... | ... | |
4787 | 4787 |
|
4788 | 4788 |
|
4789 | 4789 |
-- |
4790 |
-- Name: plantconcept_keys; Type: INDEX; Schema: public; Owner: -; Tablespace:
|
|
4790 |
-- Name: plantconcept_plantname_id_x; Type: INDEX; Schema: public; Owner: -; Tablespace:
|
|
4791 | 4791 |
-- |
4792 | 4792 |
|
4793 |
CREATE UNIQUE INDEX plantconcept_keys ON plantconcept USING btree ((COALESCE(scope_id, 0)), (COALESCE(reference_id, 0)), plantname_id);
|
|
4793 |
CREATE INDEX plantconcept_plantname_id_x ON plantconcept USING btree (plantname_id);
|
|
4794 | 4794 |
|
4795 | 4795 |
|
4796 | 4796 |
-- |
4797 |
-- Name: plantconcept_plantname_id_x; Type: INDEX; Schema: public; Owner: -; Tablespace:
|
|
4797 |
-- Name: plantconcept_reference_id_x; Type: INDEX; Schema: public; Owner: -; Tablespace:
|
|
4798 | 4798 |
-- |
4799 | 4799 |
|
4800 |
CREATE INDEX plantconcept_plantname_id_x ON plantconcept USING btree (plantname_id);
|
|
4800 |
CREATE INDEX plantconcept_reference_id_x ON plantconcept USING btree (reference_id);
|
|
4801 | 4801 |
|
4802 | 4802 |
|
4803 | 4803 |
-- |
4804 |
-- Name: plantconcept_reference_id_x; Type: INDEX; Schema: public; Owner: -; Tablespace:
|
|
4804 |
-- Name: plantconcept_unique; Type: INDEX; Schema: public; Owner: -; Tablespace:
|
|
4805 | 4805 |
-- |
4806 | 4806 |
|
4807 |
CREATE INDEX plantconcept_reference_id_x ON plantconcept USING btree (reference_id);
|
|
4807 |
CREATE UNIQUE INDEX plantconcept_unique ON plantconcept USING btree ((COALESCE(scope_id, 0)), (COALESCE(reference_id, 0)), plantname_id);
|
|
4808 | 4808 |
|
4809 | 4809 |
|
4810 | 4810 |
-- |
4811 |
-- Name: plantconceptscope_keys; Type: INDEX; Schema: public; Owner: -; Tablespace:
|
|
4811 |
-- Name: plantconceptscope_unique; Type: INDEX; Schema: public; Owner: -; Tablespace:
|
|
4812 | 4812 |
-- |
4813 | 4813 |
|
4814 |
CREATE UNIQUE INDEX plantconceptscope_keys ON plantconceptscope USING btree ((COALESCE(locationevent_id, 0)), (COALESCE(project_id, 0)), (COALESCE(namedplace_id, 0)));
|
|
4814 |
CREATE UNIQUE INDEX plantconceptscope_unique ON plantconceptscope USING btree ((COALESCE(locationevent_id, 0)), (COALESCE(project_id, 0)), (COALESCE(namedplace_id, 0)));
|
|
4815 | 4815 |
|
4816 | 4816 |
|
4817 | 4817 |
-- |
... | ... | |
5088 | 5088 |
|
5089 | 5089 |
|
5090 | 5090 |
-- |
5091 |
-- Name: taxondetermination_keys; Type: INDEX; Schema: public; Owner: -; Tablespace: |
|
5092 |
-- |
|
5093 |
|
|
5094 |
CREATE UNIQUE INDEX taxondetermination_keys ON taxondetermination USING btree (taxonoccurrence_id, role_id, (COALESCE(party_id, 0)), plantconcept_id); |
|
5095 |
|
|
5096 |
|
|
5097 |
-- |
|
5098 | 5091 |
-- Name: taxondetermination_party_id_x; Type: INDEX; Schema: public; Owner: -; Tablespace: |
5099 | 5092 |
-- |
5100 | 5093 |
|
... | ... | |
5130 | 5123 |
|
5131 | 5124 |
|
5132 | 5125 |
-- |
5126 |
-- Name: taxondetermination_unique; Type: INDEX; Schema: public; Owner: -; Tablespace: |
|
5127 |
-- |
|
5128 |
|
|
5129 |
CREATE UNIQUE INDEX taxondetermination_unique ON taxondetermination USING btree (taxonoccurrence_id, role_id, (COALESCE(party_id, 0)), plantconcept_id); |
|
5130 |
|
|
5131 |
|
|
5132 |
-- |
|
5133 | 5133 |
-- Name: taxonoccurrence_accessioncode_index; Type: INDEX; Schema: public; Owner: -; Tablespace: |
5134 | 5134 |
-- |
5135 | 5135 |
|
Also available in: Unified diff
vegbien.sql: Renamed _keys unique constraints/unique indexes to _unique to better reflect their purpose