Project

General

Profile

« Previous | Next » 

Revision 906

vegbien.sql: Added locationdetermination.identifier_id

View differences:

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