Revision 5276
Added by Matt Jones about 14 years ago
xmltables-oracle.sql | ||
---|---|---|
32 | 32 |
DROP SEQUENCE xml_catalog_id_seq; |
33 | 33 |
DROP SEQUENCE xml_relation_id_seq; |
34 | 34 |
DROP SEQUENCE xml_replication_id_seq; |
35 |
DROP SEQUENCE identifier_id_seq; |
|
36 | 35 |
DROP SEQUENCE access_log_id_seq; |
37 | 36 |
DROP SEQUENCE xml_returnfield_id_seq; |
38 | 37 |
DROP SEQUENCE xml_queryresult_id_seq; |
... | ... | |
45 | 44 |
DROP TRIGGER xml_catalog_before_insert; |
46 | 45 |
DROP TRIGGER xml_relation_before_insert; |
47 | 46 |
DROP TRIGGER xml_replication_before_insert; |
48 |
DROP TRIGGER identifier_before_insert; |
|
49 | 47 |
DROP TRIGGER access_log_before_insert; |
50 | 48 |
DROP TRIGGER xml_returnfield_before_insert; |
51 | 49 |
DROP TRIGGER xml_queryresult_before_insert; |
... | ... | |
396 | 394 |
|
397 | 395 |
/* |
398 | 396 |
* Table used to store all document identifiers in metacat. Each identifier |
399 |
* consists of 4 subparts, an authority, namespace, object, and revision as |
|
400 |
* defined in the LSID specification. |
|
397 |
* has a globally unique, unconstrained string, which we will refer to as a |
|
398 |
* GUID, and a local metacat identifier, which consists of the docid |
|
399 |
* and revision fields. Each row maps one global identifier to the local |
|
400 |
* identifier (docid) used within metacat. |
|
401 | 401 |
*/ |
402 |
CREATE SEQUENCE identifier_id_seq; |
|
403 | 402 |
CREATE TABLE identifier ( |
404 |
id NUMBER(20) PRIMARY KEY, -- primary key |
|
405 |
authority VARCHAR2(255), -- the authority issuing the identifier |
|
406 |
namespace VARCHAR2(255), -- the namespace qualifying the identifier |
|
407 |
object VARCHAR2(255), -- the local part of the identifier for a particular object |
|
408 |
revision VARCHAR2(255) -- the revision part of the identifier |
|
403 |
guid VARCHAR2(2000), -- the globally unique string identifier |
|
404 |
docid VARCHAR2(250), -- the local document id # |
|
405 |
rev NUMBER(8) -- the revision part of the local identifier |
|
409 | 406 |
); |
410 |
CREATE TRIGGER identifier_before_insert |
|
411 |
BEFORE INSERT ON identifier FOR EACH ROW |
|
412 |
BEGIN |
|
413 |
SELECT identifier_id_seq.nextval |
|
414 |
INTO :new.id |
|
415 |
FROM dual; |
|
416 |
END; |
|
417 |
/ |
|
418 | 407 |
|
419 | 408 |
/* |
420 | 409 |
* accesssubtree -- table to store access subtree info |
Also available in: Unified diff
Modified table structure to change identifiers table (previously unused) to
represent a mapping between arbitrary string identifiers and metacat docids.
More information in https://trac.dataone.org/ticket/361. Modifications to
Oracle schemas were made but not tested.