1 |
5371
|
berkley
|
CREATE TABLE systemMetadata (
|
2 |
6136
|
leinfelder
|
guid text, -- the globally unique string identifier of the object that the system metadata describes
|
3 |
|
|
date_uploaded TIMESTAMP, -- the date/time the document was first submitted
|
4 |
|
|
rights_holder VARCHAR(250), --the user who has rights to the document, usually the first persons to upload it
|
5 |
|
|
checksum VARCHAR(512), --the checksum of the doc using the given algorithm (see below)
|
6 |
|
|
checksum_algorithm VARCHAR(250), --the algorithm used to calculate the checksum
|
7 |
|
|
origin_member_node VARCHAR(250), --the member node where the document was first uploaded
|
8 |
|
|
authoritive_member_node VARCHAR(250), --the member node that currently controls the document
|
9 |
|
|
date_modified TIMESTAMP, -- the last date/time that the file was changed
|
10 |
|
|
submitter VARCHAR(256), -- the user who originally submitted the doc
|
11 |
|
|
object_format VARCHAR(256), --the format of the object
|
12 |
|
|
size VARCHAR(256), --the size of the object
|
13 |
|
|
replication_allowed boolean, -- replication allowed
|
14 |
|
|
number_replicas INT8, -- the number of replicas allowed
|
15 |
6375
|
leinfelder
|
obsoletes text, -- the identifier that this record obsoletes
|
16 |
|
|
obsoleted_by text, -- the identifier of the record that replaces this record
|
17 |
6136
|
leinfelder
|
CONSTRAINT systemMetadata_pk PRIMARY KEY (guid)
|
18 |
5371
|
berkley
|
);
|
19 |
|
|
|
20 |
6136
|
leinfelder
|
CREATE TABLE systemMetadataReplicationPolicy (
|
21 |
|
|
guid text, -- the globally unique string identifier of the object that the system metadata describes
|
22 |
|
|
member_node VARCHAR(250), -- replication member node
|
23 |
|
|
policy text, -- the policy (preferred, blocked, etc...TBD)
|
24 |
|
|
CONSTRAINT systemMetadataReplicationPolicy_fk
|
25 |
|
|
FOREIGN KEY (guid) REFERENCES systemMetadata
|
26 |
|
|
);
|
27 |
|
|
|
28 |
|
|
CREATE TABLE systemMetadataReplicationStatus (
|
29 |
|
|
guid text, -- the globally unique string identifier of the object that the system metadata describes
|
30 |
|
|
member_node VARCHAR(250), -- replication member node
|
31 |
|
|
status VARCHAR(250), -- replication status
|
32 |
|
|
date_verified TIMESTAMP, -- the date replication was verified
|
33 |
|
|
CONSTRAINT systemMetadataReplicationStatus_fk
|
34 |
|
|
FOREIGN KEY (guid) REFERENCES systemMetadata
|
35 |
|
|
);
|
36 |
|
|
|
37 |
5276
|
jones
|
CREATE TABLE identifier (
|
38 |
|
|
guid text, -- the globally unique string identifier
|
39 |
|
|
docid VARCHAR(250), -- the local document id #
|
40 |
|
|
rev INT8, -- the revision part of the local identifier
|
41 |
|
|
CONSTRAINT identifier_pk PRIMARY KEY (guid)
|
42 |
|
|
);
|
43 |
|
|
|
44 |
|
|
/*
|
45 |
6012
|
leinfelder
|
* add the nodedatadate column to the tables that need it
|
46 |
|
|
*/
|
47 |
|
|
ALTER TABLE xml_nodes ADD COLUMN nodedatadate TIMESTAMP;
|
48 |
|
|
ALTER TABLE xml_nodes_revisions ADD COLUMN nodedatadate TIMESTAMP;
|
49 |
|
|
ALTER TABLE xml_path_index ADD COLUMN nodedatadate TIMESTAMP;
|
50 |
|
|
CREATE INDEX xml_path_index_idx5 ON xml_path_index (nodedatadate);
|
51 |
|
|
|
52 |
|
|
/*
|
53 |
6136
|
leinfelder
|
* Replication changes to support DataONE System Metadata replication
|
54 |
|
|
*/
|
55 |
|
|
ALTER TABLE xml_replication ADD COLUMN systemmetadatareplicate INT8;
|
56 |
|
|
/*
|
57 |
|
|
* Allow guid in xml_access table (for system metadata)
|
58 |
|
|
*/
|
59 |
|
|
ALTER TABLE xml_access ADD COLUMN guid text;
|
60 |
|
|
|
61 |
|
|
/*
|
62 |
5400
|
jones
|
* Register the DataONE schemas
|
63 |
|
|
*/
|
64 |
6460
|
leinfelder
|
|
65 |
5400
|
jones
|
INSERT INTO xml_catalog (entry_type, public_id, system_id)
|
66 |
6460
|
leinfelder
|
VALUES ('Schema', 'http://ns.dataone.org/service/types/0.6.4', '/schema/D1_SCHEMA_0_6_4/dataoneTypes.xsd');
|
67 |
6092
|
jones
|
|
68 |
|
|
INSERT INTO xml_catalog (entry_type, public_id, system_id)
|
69 |
5709
|
leinfelder
|
VALUES ('Schema', '@eml2_1_1namespace@', '/schema/eml-2.1.1/eml.xsd');
|
70 |
5400
|
jones
|
/*
|
71 |
5276
|
jones
|
* update the database version
|
72 |
|
|
*/
|
73 |
|
|
UPDATE db_version SET status=0;
|
74 |
|
|
|
75 |
|
|
INSERT INTO db_version (version, status, date_created)
|
76 |
|
|
VALUES ('1.10.0', 1, CURRENT_DATE);
|