1
|
CREATE TABLE systemMetadata (
|
2
|
guid VARCHAR2(2000), -- the globally unique string identifier
|
3
|
docid VARCHAR(250), -- the local document id #
|
4
|
rev NUMBER(8), -- the revision part of the local identifier
|
5
|
date_uploaded DATE, -- the date/time the document was first submitted
|
6
|
rights_holder VARCHAR2(250), --the user who has rights to the document, usually the first persons to upload it
|
7
|
checksum VARCHAR2(512), --the checksum of the doc using the given algorithm (see below)
|
8
|
checksum_algorithm VARCHAR2(250), --the algorithm used to calculate the checksum
|
9
|
origin_member_node VARCHAR2(250), --the member node where the document was first uploaded
|
10
|
authoritive_member_node VARCHAR2(250), --the member node that currently controls the document
|
11
|
date_modified DATE, -- the last date/time that the file was changed
|
12
|
submitter VARCHAR2(256), -- the user who originally submitted the doc
|
13
|
object_format VARCHAR2(256), --the format of the object
|
14
|
size VARCHAR2(256) --the size of the object
|
15
|
)
|
16
|
|
17
|
CREATE TABLE identifier (
|
18
|
guid VARCHAR2(2000), -- the globally unique string identifier
|
19
|
docid VARCHAR2(250), -- the local document id #
|
20
|
rev NUMBER(8) -- the revision part of the local identifier
|
21
|
);
|
22
|
|
23
|
/*
|
24
|
* add the nodedatadate column to xml_nodes
|
25
|
* TODO: load the data into it (java?)
|
26
|
*/
|
27
|
ALTER TABLE xml_nodes ADD COLUMN nodedatadate TIMESTAMP;
|
28
|
ALTER TABLE xml_nodes_revisions ADD COLUMN nodedatadate TIMESTAMP;
|
29
|
ALTER TABLE xml_path_index ADD COLUMN nodedatadate TIMESTAMP;
|
30
|
CREATE INDEX xml_path_index_idx4 ON xml_path_index (nodedatadate);
|
31
|
|
32
|
|
33
|
/*
|
34
|
* Register the DataONE schemas
|
35
|
*/
|
36
|
INSERT INTO xml_catalog (entry_type, public_id, system_id)
|
37
|
VALUES ('Schema', 'http://dataone.org/service/types/0.5.1', '/schema/D1_SCHEMA_0_5_1/dataoneTypes.xsd');
|
38
|
INSERT INTO xml_catalog (entry_type, public_id, system_id)
|
39
|
VALUES ('Schema', 'http://ns.dataone.org/service/types/0.6.1', '/schema/D1_SCHEMA_0_6_1/dataoneTypes.xsd');
|
40
|
INSERT INTO xml_catalog (entry_type, public_id, system_id)
|
41
|
VALUES ('Schema', 'http://ns.dataone.org/service/types/0.6.2', '/schema/D1_SCHEMA_0_6_2/dataoneTypes.xsd');
|
42
|
|
43
|
INSERT INTO xml_catalog (entry_type, public_id, system_id)
|
44
|
VALUES ('Schema', '@eml2_1_1namespace@', '/schema/eml-2.1.1/eml.xsd');
|
45
|
|
46
|
/*
|
47
|
* update the database version
|
48
|
*/
|
49
|
UPDATE db_version SET status=0;
|
50
|
|
51
|
INSERT INTO db_version (version, status, date_created)
|
52
|
VALUES ('1.10.0', 1, CURRENT_DATE);
|