Project

General

Profile

1 5276 jones
DROP TABLE identifier;
2
3 5371 berkley
CREATE TABLE systemMetadata (
4
   guid   text,          -- the globally unique string identifier
5
   docid  VARCHAR(250),	 -- the local document id #
6
   rev    INT8,          -- the revision part of the local identifier
7 5887 berkley
   date_uploaded TIMESTAMP, -- the date/time the document was first submitted
8
   rights_holder VARCHAR(250), --the user who has rights to the document, usually the first persons to upload it
9
   checksum VARCHAR(512), --the checksum of the doc using the given algorithm (see below)
10
   checksum_algorithm VARCHAR(250), --the algorithm used to calculate the checksum
11
   origin_member_node VARCHAR(250), --the member node where the document was first uploaded
12
   authoritive_member_node VARCHAR(250), --the member node that currently controls the document
13
   date_modified TIMESTAMP, -- the last date/time that the file was changed
14
   submitter VARCHAR(256), -- the user who originally submitted the doc
15 5917 berkley
   object_format VARCHAR(256), --the format of the object
16
   size VARCHAR(256), --the size of the object
17 5371 berkley
   CONSTRAINT systemMetadata_pk PRIMARY KEY (guid)
18
);
19
20 5276 jones
CREATE TABLE identifier (
21
   guid   text,          -- the globally unique string identifier
22
   docid  VARCHAR(250),  -- the local document id #
23
   rev    INT8,          -- the revision part of the local identifier
24
   CONSTRAINT identifier_pk PRIMARY KEY (guid)
25
);
26
27
/*
28 6012 leinfelder
 * add the nodedatadate column to the tables that need it
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_idx5 ON xml_path_index (nodedatadate);
34
35
/*
36 5400 jones
 * Register the DataONE schemas
37
 */
38 5516 berkley
39 5400 jones
INSERT INTO xml_catalog (entry_type, public_id, system_id)
40 5657 berkley
  VALUES ('Schema', 'http://dataone.org/service/types/0.5.1', '/schema/D1_SCHEMA_0_5_1/dataoneTypes.xsd');
41 5709 leinfelder
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 5400 jones
/*
45 5276 jones
 * update the database version
46
 */
47
UPDATE db_version SET status=0;
48
49
INSERT INTO db_version (version, status, date_created)
50
  VALUES ('1.10.0', 1, CURRENT_DATE);