Project

General

Profile

« Previous | Next » 

Revision 1153

vegbien.sql: Removed methodgrowthform and growthform, since growthforms can be accommodated by plantconcept in a similar way as higher-order taxonomic ranks

View differences:

schemas/vegbien.my.sql
585 585

  
586 586

  
587 587

  
588

  
589

  
590 588
--
591
-- Name: growthform; Type: TABLE; Schema: public; Owner: -; Tablespace: 
592
--
593

  
594
CREATE TABLE growthform (
595
    growthform_id int(11) NOT NULL,
596
    name text NOT NULL
597
);
598

  
599

  
600
--
601
-- Name: COLUMN growthform.name; Type: COMMENT; Schema: public; Owner: -
602
--
603

  
604

  
605

  
606

  
607
--
608
-- Name: growthform_growthform_id_seq; Type: SEQUENCE; Schema: public; Owner: -
609
--
610

  
611

  
612

  
613

  
614
--
615
-- Name: growthform_growthform_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
616
--
617

  
618

  
619

  
620

  
621

  
622

  
623
--
624 589
-- Name: location; Type: TABLE; Schema: public; Owner: -; Tablespace: 
625 590
--
626 591

  
......
1118 1083

  
1119 1084

  
1120 1085
--
1121
-- Name: methodgrowthform; Type: TABLE; Schema: public; Owner: -; Tablespace: 
1122
--
1123

  
1124
CREATE TABLE methodgrowthform (
1125
    methodgrowthform_id int(11) NOT NULL,
1126
    method_id int(11) NOT NULL,
1127
    growthform_id int(11) NOT NULL,
1128
    included int(1) NOT NULL,
1129
    submethod_id int(11)
1130
);
1131

  
1132

  
1133
--
1134
-- Name: COLUMN methodgrowthform.included; Type: COMMENT; Schema: public; Owner: -
1135
--
1136

  
1137

  
1138

  
1139

  
1140
--
1141
-- Name: COLUMN methodgrowthform.submethod_id; Type: COMMENT; Schema: public; Owner: -
1142
--
1143

  
1144

  
1145

  
1146

  
1147
--
1148
-- Name: methodgrowthform_methodgrowthform_id_seq; Type: SEQUENCE; Schema: public; Owner: -
1149
--
1150

  
1151

  
1152

  
1153

  
1154
--
1155
-- Name: methodgrowthform_methodgrowthform_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
1156
--
1157

  
1158

  
1159

  
1160

  
1161
--
1162 1086
-- Name: methodtaxonclass; Type: TABLE; Schema: public; Owner: -; Tablespace: 
1163 1087
--
1164 1088

  
......
2539 2463

  
2540 2464

  
2541 2465
--
2542
-- Name: growthform_id; Type: DEFAULT; Schema: public; Owner: -
2543
--
2544

  
2545

  
2546

  
2547

  
2548
--
2549 2466
-- Name: location_id; Type: DEFAULT; Schema: public; Owner: -
2550 2467
--
2551 2468

  
......
2588 2505

  
2589 2506

  
2590 2507
--
2591
-- Name: methodgrowthform_id; Type: DEFAULT; Schema: public; Owner: -
2592
--
2593

  
2594

  
2595

  
2596

  
2597
--
2598 2508
-- Name: methodtaxonclass_id; Type: DEFAULT; Schema: public; Owner: -
2599 2509
--
2600 2510

  
......
3052 2962

  
3053 2963

  
3054 2964
--
3055
-- Name: growthform_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: 
3056
--
3057

  
3058
ALTER TABLE growthform
3059
    ADD CONSTRAINT growthform_pkey PRIMARY KEY (growthform_id);
3060

  
3061

  
3062
--
3063
-- Name: growthform_unique; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: 
3064
--
3065

  
3066
ALTER TABLE growthform
3067
    ADD CONSTRAINT growthform_unique UNIQUE (name);
3068

  
3069

  
3070
--
3071 2965
-- Name: location_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: 
3072 2966
--
3073 2967

  
......
3164 3058

  
3165 3059

  
3166 3060
--
3167
-- Name: methodgrowthform_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: 
3168
--
3169

  
3170
ALTER TABLE methodgrowthform
3171
    ADD CONSTRAINT methodgrowthform_pkey PRIMARY KEY (methodgrowthform_id);
3172

  
3173

  
3174
--
3175 3061
-- Name: methodtaxonclass_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: 
3176 3062
--
3177 3063

  
......
4008 3894

  
4009 3895

  
4010 3896
--
4011
-- Name: fki_methodgrowthform_growthform_id; Type: INDEX; Schema: public; Owner: -; Tablespace: 
4012
--
4013

  
4014
CREATE INDEX fki_methodgrowthform_growthform_id ON methodgrowthform  (growthform_id);
4015

  
4016

  
4017
--
4018
-- Name: fki_methodgrowthform_growthformmethod_id; Type: INDEX; Schema: public; Owner: -; Tablespace: 
4019
--
4020

  
4021
CREATE INDEX fki_methodgrowthform_growthformmethod_id ON methodgrowthform  (submethod_id);
4022

  
4023

  
4024
--
4025
-- Name: fki_methodgrowthform_method_id; Type: INDEX; Schema: public; Owner: -; Tablespace: 
4026
--
4027

  
4028
CREATE INDEX fki_methodgrowthform_method_id ON methodgrowthform  (method_id);
4029

  
4030

  
4031
--
4032 3897
-- Name: fki_methodtaxonclass_method_id; Type: INDEX; Schema: public; Owner: -; Tablespace: 
4033 3898
--
4034 3899

  
......
5226 5091

  
5227 5092

  
5228 5093
--
5229
-- Name: methodgrowthform_growthform_id; Type: FK CONSTRAINT; Schema: public; Owner: -
5230
--
5231

  
5232
ALTER TABLE methodgrowthform
5233
    ADD CONSTRAINT methodgrowthform_growthform_id FOREIGN KEY (growthform_id) REFERENCES growthform(growthform_id) ON UPDATE CASCADE ON DELETE CASCADE;
5234

  
5235

  
5236
--
5237
-- Name: methodgrowthform_method_id; Type: FK CONSTRAINT; Schema: public; Owner: -
5238
--
5239

  
5240
ALTER TABLE methodgrowthform
5241
    ADD CONSTRAINT methodgrowthform_method_id FOREIGN KEY (method_id) REFERENCES method(method_id) ON UPDATE CASCADE ON DELETE CASCADE;
5242

  
5243

  
5244
--
5245
-- Name: methodgrowthform_submethod_id; Type: FK CONSTRAINT; Schema: public; Owner: -
5246
--
5247

  
5248
ALTER TABLE methodgrowthform
5249
    ADD CONSTRAINT methodgrowthform_submethod_id FOREIGN KEY (submethod_id) REFERENCES method(method_id) ON UPDATE CASCADE ON DELETE SET NULL;
5250

  
5251

  
5252
--
5253 5094
-- Name: methodtaxonclass_method_id; Type: FK CONSTRAINT; Schema: public; Owner: -
5254 5095
--
5255 5096

  
schemas/vegbien_empty.sql
15 15
TRUNCATE disturbanceobs CASCADE;
16 16
TRUNCATE embargo CASCADE;
17 17
TRUNCATE graphic CASCADE;
18
TRUNCATE growthform CASCADE;
19 18
TRUNCATE location CASCADE;
20 19
TRUNCATE locationdetermination CASCADE;
21 20
TRUNCATE locationevent CASCADE;
22 21
TRUNCATE locationeventcontributor CASCADE;
23 22
TRUNCATE locationeventsynonym CASCADE;
24 23
TRUNCATE method CASCADE;
25
TRUNCATE methodgrowthform CASCADE;
26 24
TRUNCATE methodtaxonclass CASCADE;
27 25
TRUNCATE namedplace CASCADE;
28 26
TRUNCATE namedplacecorrelation CASCADE;
schemas/vegbien.sql
719 719
ALTER SEQUENCE graphic_graphic_id_seq OWNED BY graphic.graphic_id;
720 720

  
721 721

  
722
SET default_with_oids = false;
723

  
724 722
--
725
-- Name: growthform; Type: TABLE; Schema: public; Owner: -; Tablespace: 
726
--
727

  
728
CREATE TABLE growthform (
729
    growthform_id integer NOT NULL,
730
    name text NOT NULL
731
);
732

  
733

  
734
--
735
-- Name: COLUMN growthform.name; Type: COMMENT; Schema: public; Owner: -
736
--
737

  
738
COMMENT ON COLUMN growthform.name IS 'e.g. tree, shrub, liana, vine, herb, hemiepiphyte, epiphyte, grass, forb, woody, non-woody, cultivated, non-cultivated (not planted), exotic, native, dominant, non-dominant, vascular, nonvascular';
739

  
740

  
741
--
742
-- Name: growthform_growthform_id_seq; Type: SEQUENCE; Schema: public; Owner: -
743
--
744

  
745
CREATE SEQUENCE growthform_growthform_id_seq
746
    START WITH 1
747
    INCREMENT BY 1
748
    NO MINVALUE
749
    NO MAXVALUE
750
    CACHE 1;
751

  
752

  
753
--
754
-- Name: growthform_growthform_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
755
--
756

  
757
ALTER SEQUENCE growthform_growthform_id_seq OWNED BY growthform.growthform_id;
758

  
759

  
760
SET default_with_oids = true;
761

  
762
--
763 723
-- Name: location; Type: TABLE; Schema: public; Owner: -; Tablespace: 
764 724
--
765 725

  
......
1310 1270
SET default_with_oids = false;
1311 1271

  
1312 1272
--
1313
-- Name: methodgrowthform; Type: TABLE; Schema: public; Owner: -; Tablespace: 
1314
--
1315

  
1316
CREATE TABLE methodgrowthform (
1317
    methodgrowthform_id integer NOT NULL,
1318
    method_id integer NOT NULL,
1319
    growthform_id integer NOT NULL,
1320
    included boolean NOT NULL,
1321
    submethod_id integer
1322
);
1323

  
1324

  
1325
--
1326
-- Name: COLUMN methodgrowthform.included; Type: COMMENT; Schema: public; Owner: -
1327
--
1328

  
1329
COMMENT ON COLUMN methodgrowthform.included IS 'Whether the method includes or excludes this growth form.';
1330

  
1331

  
1332
--
1333
-- Name: COLUMN methodgrowthform.submethod_id; Type: COMMENT; Schema: public; Owner: -
1334
--
1335

  
1336
COMMENT ON COLUMN methodgrowthform.submethod_id IS 'The submethod used to sample just this growth form, distinct from the main method.';
1337

  
1338

  
1339
--
1340
-- Name: methodgrowthform_methodgrowthform_id_seq; Type: SEQUENCE; Schema: public; Owner: -
1341
--
1342

  
1343
CREATE SEQUENCE methodgrowthform_methodgrowthform_id_seq
1344
    START WITH 1
1345
    INCREMENT BY 1
1346
    NO MINVALUE
1347
    NO MAXVALUE
1348
    CACHE 1;
1349

  
1350

  
1351
--
1352
-- Name: methodgrowthform_methodgrowthform_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
1353
--
1354

  
1355
ALTER SEQUENCE methodgrowthform_methodgrowthform_id_seq OWNED BY methodgrowthform.methodgrowthform_id;
1356

  
1357

  
1358
--
1359 1273
-- Name: methodtaxonclass; Type: TABLE; Schema: public; Owner: -; Tablespace: 
1360 1274
--
1361 1275

  
......
2931 2845

  
2932 2846

  
2933 2847
--
2934
-- Name: growthform_id; Type: DEFAULT; Schema: public; Owner: -
2935
--
2936

  
2937
ALTER TABLE growthform ALTER COLUMN growthform_id SET DEFAULT nextval('growthform_growthform_id_seq'::regclass);
2938

  
2939

  
2940
--
2941 2848
-- Name: location_id; Type: DEFAULT; Schema: public; Owner: -
2942 2849
--
2943 2850

  
......
2980 2887

  
2981 2888

  
2982 2889
--
2983
-- Name: methodgrowthform_id; Type: DEFAULT; Schema: public; Owner: -
2984
--
2985

  
2986
ALTER TABLE methodgrowthform ALTER COLUMN methodgrowthform_id SET DEFAULT nextval('methodgrowthform_methodgrowthform_id_seq'::regclass);
2987

  
2988

  
2989
--
2990 2890
-- Name: methodtaxonclass_id; Type: DEFAULT; Schema: public; Owner: -
2991 2891
--
2992 2892

  
......
3444 3344

  
3445 3345

  
3446 3346
--
3447
-- Name: growthform_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: 
3448
--
3449

  
3450
ALTER TABLE ONLY growthform
3451
    ADD CONSTRAINT growthform_pkey PRIMARY KEY (growthform_id);
3452

  
3453

  
3454
--
3455
-- Name: growthform_unique; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: 
3456
--
3457

  
3458
ALTER TABLE ONLY growthform
3459
    ADD CONSTRAINT growthform_unique UNIQUE (name);
3460

  
3461

  
3462
--
3463 3347
-- Name: location_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: 
3464 3348
--
3465 3349

  
......
3556 3440

  
3557 3441

  
3558 3442
--
3559
-- Name: methodgrowthform_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: 
3560
--
3561

  
3562
ALTER TABLE ONLY methodgrowthform
3563
    ADD CONSTRAINT methodgrowthform_pkey PRIMARY KEY (methodgrowthform_id);
3564

  
3565

  
3566
--
3567 3443
-- Name: methodtaxonclass_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: 
3568 3444
--
3569 3445

  
......
4400 4276

  
4401 4277

  
4402 4278
--
4403
-- Name: fki_methodgrowthform_growthform_id; Type: INDEX; Schema: public; Owner: -; Tablespace: 
4404
--
4405

  
4406
CREATE INDEX fki_methodgrowthform_growthform_id ON methodgrowthform USING btree (growthform_id);
4407

  
4408

  
4409
--
4410
-- Name: fki_methodgrowthform_growthformmethod_id; Type: INDEX; Schema: public; Owner: -; Tablespace: 
4411
--
4412

  
4413
CREATE INDEX fki_methodgrowthform_growthformmethod_id ON methodgrowthform USING btree (submethod_id);
4414

  
4415

  
4416
--
4417
-- Name: fki_methodgrowthform_method_id; Type: INDEX; Schema: public; Owner: -; Tablespace: 
4418
--
4419

  
4420
CREATE INDEX fki_methodgrowthform_method_id ON methodgrowthform USING btree (method_id);
4421

  
4422

  
4423
--
4424 4279
-- Name: fki_methodtaxonclass_method_id; Type: INDEX; Schema: public; Owner: -; Tablespace: 
4425 4280
--
4426 4281

  
......
5632 5487

  
5633 5488

  
5634 5489
--
5635
-- Name: methodgrowthform_growthform_id; Type: FK CONSTRAINT; Schema: public; Owner: -
5636
--
5637

  
5638
ALTER TABLE ONLY methodgrowthform
5639
    ADD CONSTRAINT methodgrowthform_growthform_id FOREIGN KEY (growthform_id) REFERENCES growthform(growthform_id) ON UPDATE CASCADE ON DELETE CASCADE;
5640

  
5641

  
5642
--
5643
-- Name: methodgrowthform_method_id; Type: FK CONSTRAINT; Schema: public; Owner: -
5644
--
5645

  
5646
ALTER TABLE ONLY methodgrowthform
5647
    ADD CONSTRAINT methodgrowthform_method_id FOREIGN KEY (method_id) REFERENCES method(method_id) ON UPDATE CASCADE ON DELETE CASCADE;
5648

  
5649

  
5650
--
5651
-- Name: methodgrowthform_submethod_id; Type: FK CONSTRAINT; Schema: public; Owner: -
5652
--
5653

  
5654
ALTER TABLE ONLY methodgrowthform
5655
    ADD CONSTRAINT methodgrowthform_submethod_id FOREIGN KEY (submethod_id) REFERENCES method(method_id) ON UPDATE CASCADE ON DELETE SET NULL;
5656

  
5657

  
5658
--
5659 5490
-- Name: methodtaxonclass_method_id; Type: FK CONSTRAINT; Schema: public; Owner: -
5660 5491
--
5661 5492

  

Also available in: Unified diff