CREATE TABLE systemMetadata ( guid VARCHAR2(2000), -- the globally unique string identifier date_uploaded DATE, -- the date/time the document was first submitted rights_holder VARCHAR2(250), --the user who has rights to the document, usually the first persons to upload it checksum VARCHAR2(512), --the checksum of the doc using the given algorithm (see below) checksum_algorithm VARCHAR2(250), --the algorithm used to calculate the checksum origin_member_node VARCHAR2(250), --the member node where the document was first uploaded authoritive_member_node VARCHAR2(250), --the member node that currently controls the document date_modified DATE, -- the last date/time that the file was changed submitter VARCHAR2(256), -- the user who originally submitted the doc object_format VARCHAR2(256), --the format of the object size VARCHAR2(256), --the size of the object replication_allowed boolean, -- replication allowed number_replicas NUMBER(8), -- the number of replicas allowed CONSTRAINT systemMetadata_pk PRIMARY KEY (guid) ) /* * Table used to store system metadata provenance information */ CREATE TABLE systemMetadataProvenance ( guid VARCHAR2(2000), -- the globally unique string identifier of the object that the system metadata describes relationship VARCHAR(250), -- the provenance relationship defined between objects target_guid VARCHAR2(2000), -- the globally unique string identifier of the other object CONSTRAINT systemMetadataProvenance_fk FOREIGN KEY (guid) REFERENCES systemMetadata ); CREATE TABLE systemMetadataReplicationPolicy ( guid VARCHAR2(2000), -- the globally unique string identifier of the object that the system metadata describes member_node VARCHAR(250), -- replication member node policy VARCHAR2(2000), -- the policy (preferred, blocked, etc...TBD) CONSTRAINT systemMetadataReplicationPolicy_fk FOREIGN KEY (guid) REFERENCES systemMetadata ); CREATE TABLE systemMetadataReplicationStatus ( guid VARCHAR2(2000), -- the globally unique string identifier of the object that the system metadata describes member_node VARCHAR(250), -- replication member node status VARCHAR(250), -- replication status date_verified DATE, -- the date replication was verified CONSTRAINT systemMetadataReplicationStatus_fk FOREIGN KEY (guid) REFERENCES systemMetadata ); CREATE TABLE identifier ( guid VARCHAR2(2000), -- the globally unique string identifier docid VARCHAR2(250), -- the local document id # rev NUMBER(8) -- the revision part of the local identifier ); /* * Replication changes to support DataONE System Metadata replication */ ALTER TABLE xml_replication ADD COLUMN systemmetadatareplicate NUMBER(1); /* * Allow guid in xml_access table (for system metadata) */ ALTER TABLE xml_access ADD COLUMN guid VARCHAR2(2000); /* * add the nodedatadate column to xml_nodes * TODO: load the data into it (java?) */ ALTER TABLE xml_nodes ADD COLUMN nodedatadate TIMESTAMP; ALTER TABLE xml_nodes_revisions ADD COLUMN nodedatadate TIMESTAMP; ALTER TABLE xml_path_index ADD COLUMN nodedatadate TIMESTAMP; CREATE INDEX xml_path_index_idx4 ON xml_path_index (nodedatadate); /* * Register the DataONE schemas */ INSERT INTO xml_catalog (entry_type, public_id, system_id) VALUES ('Schema', 'http://dataone.org/service/types/0.5.1', '/schema/D1_SCHEMA_0_5_1/dataoneTypes.xsd'); INSERT INTO xml_catalog (entry_type, public_id, system_id) VALUES ('Schema', 'http://ns.dataone.org/service/types/0.6.1', '/schema/D1_SCHEMA_0_6_1/dataoneTypes.xsd'); INSERT INTO xml_catalog (entry_type, public_id, system_id) VALUES ('Schema', 'http://ns.dataone.org/service/types/0.6.2', '/schema/D1_SCHEMA_0_6_2/dataoneTypes.xsd'); INSERT INTO xml_catalog (entry_type, public_id, system_id) VALUES ('Schema', '@eml2_1_1namespace@', '/schema/eml-2.1.1/eml.xsd'); /* * update the database version */ UPDATE db_version SET status=0; INSERT INTO db_version (version, status, date_created) VALUES ('1.10.0', 1, CURRENT_DATE);