Project

General

Profile

« Previous | Next » 

Revision 906

vegbien.sql: Added locationdetermination.identifier_id

View differences:

schemas/vegbien.my.sql
998 998

  
999 999

  
1000 1000
--
1001
-- Name: locationdetermination; Type: TABLE; Schema: public; Owner: -; Tablespace: 
1002
--
1003

  
1004
CREATE TABLE locationdetermination (
1005
    locationdetermination_id int(11) NOT NULL,
1006
    location_id int(11) NOT NULL,
1007
    calculated int(1),
1008
    namedplace_id int(11) NOT NULL,
1009
    identifier_id int(11)
1010
);
1011

  
1012

  
1013
--
1014
-- Name: locationdetermination_locationdetermination_id_seq; Type: SEQUENCE; Schema: public; Owner: -
1015
--
1016

  
1017

  
1018

  
1019

  
1020
--
1021
-- Name: locationdetermination_locationdetermination_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
1022
--
1023

  
1024

  
1025

  
1026

  
1027
--
1001 1028
-- Name: locationevent; Type: TABLE; Schema: public; Owner: -; Tablespace: 
1002 1029
--
1003 1030

  
......
1184 1211

  
1185 1212

  
1186 1213
--
1187
-- Name: locationdetermination; Type: TABLE; Schema: public; Owner: -; Tablespace: 
1188
--
1189

  
1190
CREATE TABLE locationdetermination (
1191
    locationdetermination_id int(11) NOT NULL,
1192
    location_id int(11) NOT NULL,
1193
    calculated int(1),
1194
    namedplace_id int(11) NOT NULL
1195
);
1196

  
1197

  
1198
--
1199
-- Name: locationdetermination_locationdetermination_id_seq; Type: SEQUENCE; Schema: public; Owner: -
1200
--
1201

  
1202

  
1203

  
1204

  
1205
--
1206
-- Name: locationdetermination_locationdetermination_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
1207
--
1208

  
1209

  
1210

  
1211

  
1212
--
1213 1214
-- Name: namedplace; Type: TABLE; Schema: public; Owner: -; Tablespace: 
1214 1215
--
1215 1216

  
......
3136 3137

  
3137 3138

  
3138 3139
--
3139
-- Name: locationevent_id; Type: DEFAULT; Schema: public; Owner: -
3140
-- Name: locationdetermination_id; Type: DEFAULT; Schema: public; Owner: -
3140 3141
--
3141 3142

  
3142 3143

  
3143 3144

  
3144 3145

  
3145 3146
--
3146
-- Name: locationeventcontributor_id; Type: DEFAULT; Schema: public; Owner: -
3147
-- Name: locationevent_id; Type: DEFAULT; Schema: public; Owner: -
3147 3148
--
3148 3149

  
3149 3150

  
3150 3151

  
3151 3152

  
3152 3153
--
3153
-- Name: locationeventsynonym_id; Type: DEFAULT; Schema: public; Owner: -
3154
-- Name: locationeventcontributor_id; Type: DEFAULT; Schema: public; Owner: -
3154 3155
--
3155 3156

  
3156 3157

  
3157 3158

  
3158 3159

  
3159 3160
--
3160
-- Name: locationdetermination_id; Type: DEFAULT; Schema: public; Owner: -
3161
-- Name: locationeventsynonym_id; Type: DEFAULT; Schema: public; Owner: -
3161 3162
--
3162 3163

  
3163 3164

  
......
3846 3847

  
3847 3848

  
3848 3849
--
3850
-- Name: locationdetermination_keys; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: 
3851
--
3852

  
3853
ALTER TABLE locationdetermination
3854
    ADD CONSTRAINT locationdetermination_keys UNIQUE (location_id, namedplace_id);
3855

  
3856

  
3857
--
3858
-- Name: locationdetermination_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: 
3859
--
3860

  
3861
ALTER TABLE locationdetermination
3862
    ADD CONSTRAINT locationdetermination_pkey PRIMARY KEY (locationdetermination_id);
3863

  
3864

  
3865
--
3849 3866
-- Name: locationevent_keys_accessioncode; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: 
3850 3867
--
3851 3868

  
......
3886 3903

  
3887 3904

  
3888 3905
--
3889
-- Name: locationdetermination_keys; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: 
3890
--
3891

  
3892
ALTER TABLE locationdetermination
3893
    ADD CONSTRAINT locationdetermination_keys UNIQUE (location_id, namedplace_id);
3894

  
3895

  
3896
--
3897
-- Name: locationdetermination_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: 
3898
--
3899

  
3900
ALTER TABLE locationdetermination
3901
    ADD CONSTRAINT locationdetermination_pkey PRIMARY KEY (locationdetermination_id);
3902

  
3903

  
3904
--
3905 3906
-- Name: namedplace_keys; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: 
3906 3907
--
3907 3908

  
......
4815 4816

  
4816 4817

  
4817 4818
--
4819
-- Name: fki_locationdetermination_identifier_id; Type: INDEX; Schema: public; Owner: -; Tablespace: 
4820
--
4821

  
4822
CREATE INDEX fki_locationdetermination_identifier_id ON locationdetermination  (identifier_id);
4823

  
4824

  
4825
--
4818 4826
-- Name: fki_locationevent_plotmethod_id; Type: INDEX; Schema: public; Owner: -; Tablespace: 
4819 4827
--
4820 4828

  
......
4934 4942

  
4935 4943

  
4936 4944
--
4945
-- Name: locationdetermination_location_id_x; Type: INDEX; Schema: public; Owner: -; Tablespace: 
4946
--
4947

  
4948
CREATE INDEX locationdetermination_location_id_x ON locationdetermination  (location_id);
4949

  
4950

  
4951
--
4952
-- Name: locationdetermination_namedplace_id_x; Type: INDEX; Schema: public; Owner: -; Tablespace: 
4953
--
4954

  
4955
CREATE INDEX locationdetermination_namedplace_id_x ON locationdetermination  (namedplace_id);
4956

  
4957

  
4958
--
4937 4959
-- Name: locationevent_accessioncode_index; Type: INDEX; Schema: public; Owner: -; Tablespace: 
4938 4960
--
4939 4961

  
......
5032 5054

  
5033 5055

  
5034 5056
--
5035
-- Name: locationdetermination_location_id_x; Type: INDEX; Schema: public; Owner: -; Tablespace: 
5036
--
5037

  
5038
CREATE INDEX locationdetermination_location_id_x ON locationdetermination  (location_id);
5039

  
5040

  
5041
--
5042
-- Name: locationdetermination_namedplace_id_x; Type: INDEX; Schema: public; Owner: -; Tablespace: 
5043
--
5044

  
5045
CREATE INDEX locationdetermination_namedplace_id_x ON locationdetermination  (namedplace_id);
5046

  
5047

  
5048
--
5049 5057
-- Name: namedplace_accessioncode_index; Type: INDEX; Schema: public; Owner: -; Tablespace: 
5050 5058
--
5051 5059

  
......
5990 5998

  
5991 5999

  
5992 6000
--
6001
-- Name: locationdetermination_identifier_id; Type: FK CONSTRAINT; Schema: public; Owner: -
6002
--
6003

  
6004

  
6005

  
6006

  
6007
--
6008
-- Name: locationdetermination_location_id; Type: FK CONSTRAINT; Schema: public; Owner: -
6009
--
6010

  
6011
ALTER TABLE locationdetermination
6012
    ADD CONSTRAINT locationdetermination_location_id FOREIGN KEY (location_id) REFERENCES location(location_id) ON UPDATE CASCADE ON DELETE CASCADE;
6013

  
6014

  
6015
--
6016
-- Name: locationdetermination_namedplace_id; Type: FK CONSTRAINT; Schema: public; Owner: -
6017
--
6018

  
6019
ALTER TABLE locationdetermination
6020
    ADD CONSTRAINT locationdetermination_namedplace_id FOREIGN KEY (namedplace_id) REFERENCES namedplace(namedplace_id) ON UPDATE CASCADE ON DELETE CASCADE;
6021

  
6022

  
6023
--
5993 6024
-- Name: locationevent_covermethod_id; Type: FK CONSTRAINT; Schema: public; Owner: -
5994 6025
--
5995 6026

  
......
6092 6123

  
6093 6124

  
6094 6125
--
6095
-- Name: locationdetermination_location_id; Type: FK CONSTRAINT; Schema: public; Owner: -
6096
--
6097

  
6098
ALTER TABLE locationdetermination
6099
    ADD CONSTRAINT locationdetermination_location_id FOREIGN KEY (location_id) REFERENCES location(location_id) ON UPDATE CASCADE ON DELETE CASCADE;
6100

  
6101

  
6102
--
6103
-- Name: locationdetermination_namedplace_id; Type: FK CONSTRAINT; Schema: public; Owner: -
6104
--
6105

  
6106
ALTER TABLE locationdetermination
6107
    ADD CONSTRAINT locationdetermination_namedplace_id FOREIGN KEY (namedplace_id) REFERENCES namedplace(namedplace_id) ON UPDATE CASCADE ON DELETE CASCADE;
6108

  
6109

  
6110
--
6111 6126
-- Name: namedplace_reference_id; Type: FK CONSTRAINT; Schema: public; Owner: -
6112 6127
--
6113 6128

  
schemas/vegbien_empty.sql
30 30
TRUNCATE keywords CASCADE;
31 31
TRUNCATE keywords_extra CASCADE;
32 32
TRUNCATE location CASCADE;
33
TRUNCATE locationdetermination CASCADE;
33 34
TRUNCATE locationevent CASCADE;
34 35
TRUNCATE locationeventcontributor CASCADE;
35 36
TRUNCATE locationeventsynonym CASCADE;
36
TRUNCATE locationdetermination CASCADE;
37 37
TRUNCATE namedplace CASCADE;
38 38
TRUNCATE namedplacecorrelation CASCADE;
39 39
TRUNCATE note CASCADE;
schemas/vegbien.sql
1164 1164

  
1165 1165

  
1166 1166
--
1167
-- Name: locationdetermination; Type: TABLE; Schema: public; Owner: -; Tablespace: 
1168
--
1169

  
1170
CREATE TABLE locationdetermination (
1171
    locationdetermination_id integer NOT NULL,
1172
    location_id integer NOT NULL,
1173
    calculated boolean,
1174
    namedplace_id integer NOT NULL,
1175
    identifier_id integer
1176
);
1177

  
1178

  
1179
--
1180
-- Name: locationdetermination_locationdetermination_id_seq; Type: SEQUENCE; Schema: public; Owner: -
1181
--
1182

  
1183
CREATE SEQUENCE locationdetermination_locationdetermination_id_seq
1184
    START WITH 1
1185
    INCREMENT BY 1
1186
    NO MINVALUE
1187
    NO MAXVALUE
1188
    CACHE 1;
1189

  
1190

  
1191
--
1192
-- Name: locationdetermination_locationdetermination_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
1193
--
1194

  
1195
ALTER SEQUENCE locationdetermination_locationdetermination_id_seq OWNED BY locationdetermination.locationdetermination_id;
1196

  
1197

  
1198
--
1167 1199
-- Name: locationevent; Type: TABLE; Schema: public; Owner: -; Tablespace: 
1168 1200
--
1169 1201

  
......
1365 1397

  
1366 1398

  
1367 1399
--
1368
-- Name: locationdetermination; Type: TABLE; Schema: public; Owner: -; Tablespace: 
1369
--
1370

  
1371
CREATE TABLE locationdetermination (
1372
    locationdetermination_id integer NOT NULL,
1373
    location_id integer NOT NULL,
1374
    calculated boolean,
1375
    namedplace_id integer NOT NULL
1376
);
1377

  
1378

  
1379
--
1380
-- Name: locationdetermination_locationdetermination_id_seq; Type: SEQUENCE; Schema: public; Owner: -
1381
--
1382

  
1383
CREATE SEQUENCE locationdetermination_locationdetermination_id_seq
1384
    START WITH 1
1385
    INCREMENT BY 1
1386
    NO MINVALUE
1387
    NO MAXVALUE
1388
    CACHE 1;
1389

  
1390

  
1391
--
1392
-- Name: locationdetermination_locationdetermination_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
1393
--
1394

  
1395
ALTER SEQUENCE locationdetermination_locationdetermination_id_seq OWNED BY locationdetermination.locationdetermination_id;
1396

  
1397

  
1398
--
1399 1400
-- Name: namedplace; Type: TABLE; Schema: public; Owner: -; Tablespace: 
1400 1401
--
1401 1402

  
......
3592 3593

  
3593 3594

  
3594 3595
--
3596
-- Name: locationdetermination_id; Type: DEFAULT; Schema: public; Owner: -
3597
--
3598

  
3599
ALTER TABLE locationdetermination ALTER COLUMN locationdetermination_id SET DEFAULT nextval('locationdetermination_locationdetermination_id_seq'::regclass);
3600

  
3601

  
3602
--
3595 3603
-- Name: locationevent_id; Type: DEFAULT; Schema: public; Owner: -
3596 3604
--
3597 3605

  
......
3613 3621

  
3614 3622

  
3615 3623
--
3616
-- Name: locationdetermination_id; Type: DEFAULT; Schema: public; Owner: -
3617
--
3618

  
3619
ALTER TABLE locationdetermination ALTER COLUMN locationdetermination_id SET DEFAULT nextval('locationdetermination_locationdetermination_id_seq'::regclass);
3620

  
3621

  
3622
--
3623 3624
-- Name: namedplace_id; Type: DEFAULT; Schema: public; Owner: -
3624 3625
--
3625 3626

  
......
4302 4303

  
4303 4304

  
4304 4305
--
4306
-- Name: locationdetermination_keys; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: 
4307
--
4308

  
4309
ALTER TABLE ONLY locationdetermination
4310
    ADD CONSTRAINT locationdetermination_keys UNIQUE (location_id, namedplace_id);
4311

  
4312

  
4313
--
4314
-- Name: locationdetermination_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: 
4315
--
4316

  
4317
ALTER TABLE ONLY locationdetermination
4318
    ADD CONSTRAINT locationdetermination_pkey PRIMARY KEY (locationdetermination_id);
4319

  
4320

  
4321
--
4305 4322
-- Name: locationevent_keys_accessioncode; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: 
4306 4323
--
4307 4324

  
......
4342 4359

  
4343 4360

  
4344 4361
--
4345
-- Name: locationdetermination_keys; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: 
4346
--
4347

  
4348
ALTER TABLE ONLY locationdetermination
4349
    ADD CONSTRAINT locationdetermination_keys UNIQUE (location_id, namedplace_id);
4350

  
4351

  
4352
--
4353
-- Name: locationdetermination_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: 
4354
--
4355

  
4356
ALTER TABLE ONLY locationdetermination
4357
    ADD CONSTRAINT locationdetermination_pkey PRIMARY KEY (locationdetermination_id);
4358

  
4359

  
4360
--
4361 4362
-- Name: namedplace_keys; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: 
4362 4363
--
4363 4364

  
......
5271 5272

  
5272 5273

  
5273 5274
--
5275
-- Name: fki_locationdetermination_identifier_id; Type: INDEX; Schema: public; Owner: -; Tablespace: 
5276
--
5277

  
5278
CREATE INDEX fki_locationdetermination_identifier_id ON locationdetermination USING btree (identifier_id);
5279

  
5280

  
5281
--
5274 5282
-- Name: fki_locationevent_plotmethod_id; Type: INDEX; Schema: public; Owner: -; Tablespace: 
5275 5283
--
5276 5284

  
......
5390 5398

  
5391 5399

  
5392 5400
--
5401
-- Name: locationdetermination_location_id_x; Type: INDEX; Schema: public; Owner: -; Tablespace: 
5402
--
5403

  
5404
CREATE INDEX locationdetermination_location_id_x ON locationdetermination USING btree (location_id);
5405

  
5406

  
5407
--
5408
-- Name: locationdetermination_namedplace_id_x; Type: INDEX; Schema: public; Owner: -; Tablespace: 
5409
--
5410

  
5411
CREATE INDEX locationdetermination_namedplace_id_x ON locationdetermination USING btree (namedplace_id);
5412

  
5413

  
5414
--
5393 5415
-- Name: locationevent_accessioncode_index; Type: INDEX; Schema: public; Owner: -; Tablespace: 
5394 5416
--
5395 5417

  
......
5488 5510

  
5489 5511

  
5490 5512
--
5491
-- Name: locationdetermination_location_id_x; Type: INDEX; Schema: public; Owner: -; Tablespace: 
5492
--
5493

  
5494
CREATE INDEX locationdetermination_location_id_x ON locationdetermination USING btree (location_id);
5495

  
5496

  
5497
--
5498
-- Name: locationdetermination_namedplace_id_x; Type: INDEX; Schema: public; Owner: -; Tablespace: 
5499
--
5500

  
5501
CREATE INDEX locationdetermination_namedplace_id_x ON locationdetermination USING btree (namedplace_id);
5502

  
5503

  
5504
--
5505 5513
-- Name: namedplace_accessioncode_index; Type: INDEX; Schema: public; Owner: -; Tablespace: 
5506 5514
--
5507 5515

  
......
6456 6464

  
6457 6465

  
6458 6466
--
6467
-- Name: locationdetermination_identifier_id; Type: FK CONSTRAINT; Schema: public; Owner: -
6468
--
6469

  
6470
ALTER TABLE ONLY locationdetermination
6471
    ADD CONSTRAINT locationdetermination_identifier_id FOREIGN KEY (identifier_id) REFERENCES party(party_id) ON UPDATE CASCADE ON DELETE CASCADE;
6472

  
6473

  
6474
--
6475
-- Name: locationdetermination_location_id; Type: FK CONSTRAINT; Schema: public; Owner: -
6476
--
6477

  
6478
ALTER TABLE ONLY locationdetermination
6479
    ADD CONSTRAINT locationdetermination_location_id FOREIGN KEY (location_id) REFERENCES location(location_id) ON UPDATE CASCADE ON DELETE CASCADE;
6480

  
6481

  
6482
--
6483
-- Name: locationdetermination_namedplace_id; Type: FK CONSTRAINT; Schema: public; Owner: -
6484
--
6485

  
6486
ALTER TABLE ONLY locationdetermination
6487
    ADD CONSTRAINT locationdetermination_namedplace_id FOREIGN KEY (namedplace_id) REFERENCES namedplace(namedplace_id) ON UPDATE CASCADE ON DELETE CASCADE;
6488

  
6489

  
6490
--
6459 6491
-- Name: locationevent_covermethod_id; Type: FK CONSTRAINT; Schema: public; Owner: -
6460 6492
--
6461 6493

  
......
6560 6592

  
6561 6593

  
6562 6594
--
6563
-- Name: locationdetermination_location_id; Type: FK CONSTRAINT; Schema: public; Owner: -
6564
--
6565

  
6566
ALTER TABLE ONLY locationdetermination
6567
    ADD CONSTRAINT locationdetermination_location_id FOREIGN KEY (location_id) REFERENCES location(location_id) ON UPDATE CASCADE ON DELETE CASCADE;
6568

  
6569

  
6570
--
6571
-- Name: locationdetermination_namedplace_id; Type: FK CONSTRAINT; Schema: public; Owner: -
6572
--
6573

  
6574
ALTER TABLE ONLY locationdetermination
6575
    ADD CONSTRAINT locationdetermination_namedplace_id FOREIGN KEY (namedplace_id) REFERENCES namedplace(namedplace_id) ON UPDATE CASCADE ON DELETE CASCADE;
6576

  
6577

  
6578
--
6579 6595
-- Name: namedplace_reference_id; Type: FK CONSTRAINT; Schema: public; Owner: -
6580 6596
--
6581 6597

  

Also available in: Unified diff