Project

General

Profile

« Previous | Next » 

Revision 955

vegbien.sql: Added methodtrait and methodtraitname tables

View differences:

vegbien.sql
18 18
SET search_path = public, pg_catalog;
19 19

  
20 20
--
21
-- Name: methodtraitname_appliesto; Type: TYPE; Schema: public; Owner: -
22
--
23

  
24
CREATE TYPE methodtraitname_appliesto AS ENUM (
25
    'locationevent',
26
    'taxonoccurrence'
27
);
28

  
29

  
30
--
21 31
-- Name: occurrencestatus_dwc; Type: TYPE; Schema: public; Owner: -
22 32
--
23 33

  
......
1429 1439
ALTER SEQUENCE method_method_id_seq OWNED BY method.method_id;
1430 1440

  
1431 1441

  
1442
SET default_with_oids = false;
1443

  
1432 1444
--
1445
-- Name: methodtrait; Type: TABLE; Schema: public; Owner: -; Tablespace: 
1446
--
1447

  
1448
CREATE TABLE methodtrait (
1449
    methodtrait_id integer NOT NULL,
1450
    method_id integer NOT NULL,
1451
    methodtraitname_id integer NOT NULL,
1452
    value text NOT NULL
1453
);
1454

  
1455

  
1456
--
1457
-- Name: methodtrait_methodtrait_id_seq; Type: SEQUENCE; Schema: public; Owner: -
1458
--
1459

  
1460
CREATE SEQUENCE methodtrait_methodtrait_id_seq
1461
    START WITH 1
1462
    INCREMENT BY 1
1463
    NO MINVALUE
1464
    NO MAXVALUE
1465
    CACHE 1;
1466

  
1467

  
1468
--
1469
-- Name: methodtrait_methodtrait_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
1470
--
1471

  
1472
ALTER SEQUENCE methodtrait_methodtrait_id_seq OWNED BY methodtrait.methodtrait_id;
1473

  
1474

  
1475
--
1476
-- Name: methodtraitname; Type: TABLE; Schema: public; Owner: -; Tablespace: 
1477
--
1478

  
1479
CREATE TABLE methodtraitname (
1480
    methodtraitname_id integer NOT NULL,
1481
    name text NOT NULL,
1482
    appliesto methodtraitname_appliesto[] NOT NULL
1483
);
1484

  
1485

  
1486
--
1487
-- Name: methodtraitname_methodtraitname_id_seq; Type: SEQUENCE; Schema: public; Owner: -
1488
--
1489

  
1490
CREATE SEQUENCE methodtraitname_methodtraitname_id_seq
1491
    START WITH 1
1492
    INCREMENT BY 1
1493
    NO MINVALUE
1494
    NO MAXVALUE
1495
    CACHE 1;
1496

  
1497

  
1498
--
1499
-- Name: methodtraitname_methodtraitname_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
1500
--
1501

  
1502
ALTER SEQUENCE methodtraitname_methodtraitname_id_seq OWNED BY methodtraitname.methodtraitname_id;
1503

  
1504

  
1505
SET default_with_oids = true;
1506

  
1507
--
1433 1508
-- Name: namedplace; Type: TABLE; Schema: public; Owner: -; Tablespace: 
1434 1509
--
1435 1510

  
......
3632 3707

  
3633 3708

  
3634 3709
--
3710
-- Name: methodtrait_id; Type: DEFAULT; Schema: public; Owner: -
3711
--
3712

  
3713
ALTER TABLE methodtrait ALTER COLUMN methodtrait_id SET DEFAULT nextval('methodtrait_methodtrait_id_seq'::regclass);
3714

  
3715

  
3716
--
3717
-- Name: methodtraitname_id; Type: DEFAULT; Schema: public; Owner: -
3718
--
3719

  
3720
ALTER TABLE methodtraitname ALTER COLUMN methodtraitname_id SET DEFAULT nextval('methodtraitname_methodtraitname_id_seq'::regclass);
3721

  
3722

  
3723
--
3635 3724
-- Name: namedplace_id; Type: DEFAULT; Schema: public; Owner: -
3636 3725
--
3637 3726

  
......
4355 4444

  
4356 4445

  
4357 4446
--
4447
-- Name: methodtrait_keys; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: 
4448
--
4449

  
4450
ALTER TABLE ONLY methodtrait
4451
    ADD CONSTRAINT methodtrait_keys UNIQUE (method_id, methodtraitname_id);
4452

  
4453

  
4454
--
4455
-- Name: methodtrait_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: 
4456
--
4457

  
4458
ALTER TABLE ONLY methodtrait
4459
    ADD CONSTRAINT methodtrait_pkey PRIMARY KEY (methodtrait_id);
4460

  
4461

  
4462
--
4463
-- Name: methodtraitname_keys; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: 
4464
--
4465

  
4466
ALTER TABLE ONLY methodtraitname
4467
    ADD CONSTRAINT methodtraitname_keys UNIQUE (name);
4468

  
4469

  
4470
--
4471
-- Name: methodtraitname_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: 
4472
--
4473

  
4474
ALTER TABLE ONLY methodtraitname
4475
    ADD CONSTRAINT methodtraitname_pkey PRIMARY KEY (methodtraitname_id);
4476

  
4477

  
4478
--
4358 4479
-- Name: namedplace_keys; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: 
4359 4480
--
4360 4481

  
......
5288 5409

  
5289 5410

  
5290 5411
--
5412
-- Name: fki_methodtrait_method_id; Type: INDEX; Schema: public; Owner: -; Tablespace: 
5413
--
5414

  
5415
CREATE INDEX fki_methodtrait_method_id ON methodtrait USING btree (method_id);
5416

  
5417

  
5418
--
5419
-- Name: fki_methodtrait_methodtraitname_id; Type: INDEX; Schema: public; Owner: -; Tablespace: 
5420
--
5421

  
5422
CREATE INDEX fki_methodtrait_methodtraitname_id ON methodtrait USING btree (methodtraitname_id);
5423

  
5424

  
5425
--
5291 5426
-- Name: fki_plantconcept_scope_id; Type: INDEX; Schema: public; Owner: -; Tablespace: 
5292 5427
--
5293 5428

  
......
6631 6766

  
6632 6767

  
6633 6768
--
6769
-- Name: methodtrait_method_id; Type: FK CONSTRAINT; Schema: public; Owner: -
6770
--
6771

  
6772
ALTER TABLE ONLY methodtrait
6773
    ADD CONSTRAINT methodtrait_method_id FOREIGN KEY (method_id) REFERENCES method(method_id) ON UPDATE CASCADE ON DELETE CASCADE;
6774

  
6775

  
6776
--
6777
-- Name: methodtrait_methodtraitname_id; Type: FK CONSTRAINT; Schema: public; Owner: -
6778
--
6779

  
6780
ALTER TABLE ONLY methodtrait
6781
    ADD CONSTRAINT methodtrait_methodtraitname_id FOREIGN KEY (methodtraitname_id) REFERENCES methodtraitname(methodtraitname_id) ON UPDATE CASCADE ON DELETE CASCADE;
6782

  
6783

  
6784
--
6634 6785
-- Name: namedplace_reference_id; Type: FK CONSTRAINT; Schema: public; Owner: -
6635 6786
--
6636 6787

  

Also available in: Unified diff