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