Project

General

Profile

« Previous | Next » 

Revision 2769

Added by Matt Jones over 18 years ago

New SQL tables and db upgrade scripts that define a new table stucture for identifiers and delete the previously unused accession_number table. This is in anticipation of supporting LSID identifiers. Currently these tables are unused by the servlet but are in place for discussion.

View differences:

xmltables.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 accession_number_id_seq;
35
DROP SEQUENCE identifier_id_seq;
36 36
DROP SEQUENCE access_log_id_seq;
37 37
DROP SEQUENCE xml_returnfield_id_seq;
38 38
DROP SEQUENCE xml_queryresult_id_seq;
......
44 44
DROP TRIGGER xml_catalog_before_insert;
45 45
DROP TRIGGER xml_relation_before_insert;
46 46
DROP TRIGGER xml_replication_before_insert;
47
DROP TRIGGER accession_number_before_insert;
47
DROP TRIGGER identifier_before_insert;
48 48
DROP TRIGGER access_log_before_insert;
49 49
DROP TRIGGER xml_returnfield_before_insert;
50 50
DROP TRIGGER xml_queryresult_before_insert;
......
60 60
DROP TABLE xml_nodes_revisions;
61 61
DROP TABLE xml_replication;
62 62
DROP TABLE xml_catalog;
63
DROP TABLE accession_number;
63
DROP TABLE identifier;
64 64
DROP TABLE access_log;
65 65
DROP TABLE harvest_site_schedule;
66 66
DROP TABLE harvest_detail_log;
......
383 383
/
384 384

  
385 385
/*
386
 * Table used as Unique ID generator for the uniqueid part of Accession#
386
 * Table used to store all document identifiers in metacat.  Each identifier
387
 * consists of 4 subparts, an authority, namespace, object, and revision as
388
 * defined in the LSID specification.
387 389
 */
388
CREATE SEQUENCE accession_number_id_seq;
389
CREATE TABLE accession_number (
390
	uniqueid	NUMBER(20) PRIMARY KEY,
391
	site_code	VARCHAR2(100),
392
	date_created	DATE
390
CREATE SEQUENCE identifier_id_seq;
391
CREATE TABLE identifier (
392
   id        NUMBER(20) PRIMARY KEY, -- primary key
393
   authority VARCHAR2(255),  -- the authority issuing the identifier
394
   namespace VARCHAR2(255),  -- the namespace qualifying the identifier
395
   object    VARCHAR2(255),  -- the local part of the identifier for a particular object
396
   revision  VARCHAR2(255)   -- the revision part of the identifier
393 397
);
394
CREATE TRIGGER accession_number_before_insert
395
BEFORE INSERT ON accession_number FOR EACH ROW
398
CREATE TRIGGER identifier_before_insert
399
BEFORE INSERT ON identifier FOR EACH ROW
396 400
BEGIN
397
  SELECT accession_number_id_seq.nextval
398
    INTO :new.uniqueid
401
  SELECT identifier_id_seq.nextval
402
    INTO :new.id
399 403
    FROM dual;
400 404
END;
401 405
/

Also available in: Unified diff