DROP SEQUENCE identifier_id_seq;
DROP TRIGGER identifier_before_insert;
DROP TABLE identifier;

CREATE TABLE systemMetadata (
   guid   VARCHAR2(2000),    -- the globally unique string identifier
   docid  VARCHAR(250), 	 -- the local document id #
   rev    NUMBER(8)          -- the revision part of the local identifier
)

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
);

/*
 * Register the DataONE schemas
 */
INSERT INTO xml_catalog (entry_type, public_id, system_id)
  VALUES ('Schema', 'http://dataone.org/service/types/SystemMetadata/0.1', '/schema/D1_SCHEMA_0_1/systemmetadata.xsd');
INSERT INTO xml_catalog (entry_type, public_id, system_id)
  VALUES ('Schema', 'http://dataone.org/service/types/common/0.1', '/schema/D1_SCHEMA_0_1/common.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);
