Project

General

Profile

« Previous | Next » 

Revision 5660

schemas/vegbien.sql: taxonverbatim: Removed subclass relationship to taxonlabel in order to allow multiple taxonverbatims to point to the same taxonlabel. This involves adding a taxonverbatim_id serial column and pointing all fkeys to taxonverbatim to that column.

View differences:

schemas/vegbien.my.sql
1028 1028
--
1029 1029

  
1030 1030
CREATE TABLE taxonverbatim (
1031
    taxonverbatim_id int(11) NOT NULL,
1031 1032
    taxonlabel_id int(11) NOT NULL,
1032 1033
    verbatimrank text,
1033 1034
    taxonomicname text,
......
2601 2602

  
2602 2603

  
2603 2604
--
2605
-- Name: taxonverbatim_taxonverbatim_id_seq; Type: SEQUENCE; Schema: public; Owner: -
2606
--
2607

  
2608

  
2609

  
2610

  
2611
--
2612
-- Name: taxonverbatim_taxonverbatim_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
2613
--
2614

  
2615

  
2616

  
2617

  
2618
--
2604 2619
-- Name: telephone; Type: TABLE; Schema: public; Owner: -; Tablespace: 
2605 2620
--
2606 2621

  
......
3085 3100

  
3086 3101

  
3087 3102
--
3103
-- Name: taxonverbatim_id; Type: DEFAULT; Schema: public; Owner: -
3104
--
3105

  
3106

  
3107

  
3108

  
3109
--
3088 3110
-- Name: telephone_id; Type: DEFAULT; Schema: public; Owner: -
3089 3111
--
3090 3112

  
......
3645 3667
--
3646 3668

  
3647 3669
ALTER TABLE taxonverbatim
3648
    ADD CONSTRAINT taxonverbatim_pkey PRIMARY KEY (taxonlabel_id);
3670
    ADD CONSTRAINT taxonverbatim_pkey PRIMARY KEY (taxonverbatim_id);
3649 3671

  
3650 3672

  
3651 3673
--
3674
-- Name: taxonverbatim_unique; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: 
3675
--
3676

  
3677
ALTER TABLE taxonverbatim
3678
    ADD CONSTRAINT taxonverbatim_unique UNIQUE (taxonlabel_id);
3679

  
3680

  
3681
--
3652 3682
-- Name: telephone_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: 
3653 3683
--
3654 3684

  
......
5009 5039
--
5010 5040

  
5011 5041
ALTER TABLE taxondetermination
5012
    ADD CONSTRAINT taxondetermination_taxonverbatim_id_fkey FOREIGN KEY (taxonverbatim_id) REFERENCES taxonverbatim(taxonlabel_id) ON UPDATE CASCADE ON DELETE CASCADE;
5042
    ADD CONSTRAINT taxondetermination_taxonverbatim_id_fkey FOREIGN KEY (taxonverbatim_id) REFERENCES taxonverbatim(taxonverbatim_id) ON UPDATE CASCADE ON DELETE CASCADE;
5013 5043

  
5014 5044

  
5015 5045
--
schemas/vegbien.sql
1481 1481
--
1482 1482

  
1483 1483
CREATE TABLE taxonverbatim (
1484
    taxonverbatim_id integer NOT NULL,
1484 1485
    taxonlabel_id integer NOT NULL,
1485 1486
    verbatimrank text,
1486 1487
    taxonomicname text,
......
3334 3335

  
3335 3336

  
3336 3337
--
3338
-- Name: taxonverbatim_taxonverbatim_id_seq; Type: SEQUENCE; Schema: public; Owner: -
3339
--
3340

  
3341
CREATE SEQUENCE taxonverbatim_taxonverbatim_id_seq
3342
    START WITH 1
3343
    INCREMENT BY 1
3344
    NO MINVALUE
3345
    NO MAXVALUE
3346
    CACHE 1;
3347

  
3348

  
3349
--
3350
-- Name: taxonverbatim_taxonverbatim_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
3351
--
3352

  
3353
ALTER SEQUENCE taxonverbatim_taxonverbatim_id_seq OWNED BY taxonverbatim.taxonverbatim_id;
3354

  
3355

  
3356
--
3337 3357
-- Name: telephone; Type: TABLE; Schema: public; Owner: -; Tablespace: 
3338 3358
--
3339 3359

  
......
3838 3858

  
3839 3859

  
3840 3860
--
3861
-- Name: taxonverbatim_id; Type: DEFAULT; Schema: public; Owner: -
3862
--
3863

  
3864
ALTER TABLE taxonverbatim ALTER COLUMN taxonverbatim_id SET DEFAULT nextval('taxonverbatim_taxonverbatim_id_seq'::regclass);
3865

  
3866

  
3867
--
3841 3868
-- Name: telephone_id; Type: DEFAULT; Schema: public; Owner: -
3842 3869
--
3843 3870

  
......
4398 4425
--
4399 4426

  
4400 4427
ALTER TABLE ONLY taxonverbatim
4401
    ADD CONSTRAINT taxonverbatim_pkey PRIMARY KEY (taxonlabel_id);
4428
    ADD CONSTRAINT taxonverbatim_pkey PRIMARY KEY (taxonverbatim_id);
4402 4429

  
4403 4430

  
4404 4431
--
4432
-- Name: taxonverbatim_unique; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: 
4433
--
4434

  
4435
ALTER TABLE ONLY taxonverbatim
4436
    ADD CONSTRAINT taxonverbatim_unique UNIQUE (taxonlabel_id);
4437

  
4438

  
4439
--
4405 4440
-- Name: telephone_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: 
4406 4441
--
4407 4442

  
......
5797 5832
--
5798 5833

  
5799 5834
ALTER TABLE ONLY taxondetermination
5800
    ADD CONSTRAINT taxondetermination_taxonverbatim_id_fkey FOREIGN KEY (taxonverbatim_id) REFERENCES taxonverbatim(taxonlabel_id) ON UPDATE CASCADE ON DELETE CASCADE;
5835
    ADD CONSTRAINT taxondetermination_taxonverbatim_id_fkey FOREIGN KEY (taxonverbatim_id) REFERENCES taxonverbatim(taxonverbatim_id) ON UPDATE CASCADE ON DELETE CASCADE;
5801 5836

  
5802 5837

  
5803 5838
--

Also available in: Unified diff