Fixes to Oracle Schema scripts based on DS-289: OAI-PMH + OAI-ORE harvesting support.

These seem to create the tables properly in Oracle 10g (based on my limited testing with a local Oracle install), and they also help fix DS-423 for Oracle.

git-svn-id: http://scm.dspace.org/svn/repo/dspace/trunk@4719 9c30dcfa-912a-0410-8fc2-9e0234be79fd
This commit is contained in:
Tim Donohue
2010-01-22 18:37:13 +00:00
parent 299eb9202b
commit 9ff36ebfb7
3 changed files with 194 additions and 122 deletions

View File

@@ -69,6 +69,8 @@ CREATE SEQUENCE metadatafieldregistry_seq;
CREATE SEQUENCE metadatavalue_seq; CREATE SEQUENCE metadatavalue_seq;
CREATE SEQUENCE group2group_seq; CREATE SEQUENCE group2group_seq;
CREATE SEQUENCE group2groupcache_seq; CREATE SEQUENCE group2groupcache_seq;
CREATE SEQUENCE harvested_collection_seq;
CREATE SEQUENCE harvested_item_seq;
------------------------------------------------------- -------------------------------------------------------
-- BitstreamFormatRegistry table -- BitstreamFormatRegistry table
@@ -534,9 +536,6 @@ CREATE TABLE EPersonGroup2WorkspaceItem
CREATE INDEX epg2wi_group_fk_idx ON epersongroup2workspaceitem(eperson_group_id); CREATE INDEX epg2wi_group_fk_idx ON epersongroup2workspaceitem(eperson_group_id);
CREATE INDEX epg2wi_workspace_fk_idx ON epersongroup2workspaceitem(workspace_item_id); CREATE INDEX epg2wi_workspace_fk_idx ON epersongroup2workspaceitem(workspace_item_id);
------------------------------------------------------------
-- Browse subsystem tables and views
------------------------------------------------------------
------------------------------------------------------- -------------------------------------------------------
-- Communities2Item table -- Communities2Item table
@@ -701,3 +700,36 @@ values
'BITSTREAM_MARKED_DELETED', 'BITSTREAM_MARKED_DELETED',
'Bitstream marked deleted in bitstream table' 'Bitstream marked deleted in bitstream table'
); );
-------------------------------------------------------
-- Create the harvest settings table
-------------------------------------------------------
-- Values used by the OAIHarvester to harvest a collection
-- HarvestInstance is the DAO class for this table
CREATE TABLE harvested_collection
(
collection_id INTEGER REFERENCES collection(collection_id) ON DELETE CASCADE,
harvest_type INTEGER,
oai_source VARCHAR(256),
oai_set_id VARCHAR(256),
harvest_message VARCHAR2(512),
metadata_config_id VARCHAR(256),
harvest_status INTEGER,
harvest_start_time TIMESTAMP,
last_harvested TIMESTAMP,
id INTEGER PRIMARY KEY
);
CREATE INDEX harvested_collection_fk_idx ON harvested_collection(collection_id);
CREATE TABLE harvested_item
(
item_id INTEGER REFERENCES item(item_id) ON DELETE CASCADE,
last_harvested TIMESTAMP,
oai_id VARCHAR(64),
id INTEGER PRIMARY KEY
);
CREATE INDEX harvested_item_fk_idx ON harvested_item(item_id);

View File

@@ -110,3 +110,44 @@ select 'ALTER TABLE '||c1.table_name||' DROP CONSTRAINT '||
select 'ALTER TABLE community2collection ADD CONSTRAINT comm2coll_collection_fk FOREIGN KEY (collection_id) REFERENCES collection DEFERRABLE;' from dual; select 'ALTER TABLE community2collection ADD CONSTRAINT comm2coll_collection_fk FOREIGN KEY (collection_id) REFERENCES collection DEFERRABLE;' from dual;
select 'ALTER TABLE community2community ADD CONSTRAINT com2com_child_fk FOREIGN KEY (child_comm_id) REFERENCES community DEFERRABLE;' from dual; select 'ALTER TABLE community2community ADD CONSTRAINT com2com_child_fk FOREIGN KEY (child_comm_id) REFERENCES community DEFERRABLE;' from dual;
select 'ALTER TABLE collection2item ADD CONSTRAINT coll2item_item_fk FOREIGN KEY (item_id) REFERENCES item DEFERRABLE;' from dual; select 'ALTER TABLE collection2item ADD CONSTRAINT coll2item_item_fk FOREIGN KEY (item_id) REFERENCES item DEFERRABLE;' from dual;
------------------------------------------------------------------
-- New tables /sequences for the harvester functionality (DS-289)
------------------------------------------------------------------
CREATE SEQUENCE harvested_collection_seq;
CREATE SEQUENCE harvested_item_seq;
-------------------------------------------------------
-- Create the harvest settings table
-------------------------------------------------------
-- Values used by the OAIHarvester to harvest a collection
-- HarvestInstance is the DAO class for this table
CREATE TABLE harvested_collection
(
collection_id INTEGER REFERENCES collection(collection_id) ON DELETE CASCADE,
harvest_type INTEGER,
oai_source VARCHAR(256),
oai_set_id VARCHAR(256),
harvest_message VARCHAR2(512),
metadata_config_id VARCHAR(256),
harvest_status INTEGER,
harvest_start_time TIMESTAMP,
last_harvested TIMESTAMP,
id INTEGER PRIMARY KEY
);
CREATE INDEX harvested_collection_fk_idx ON harvested_collection(collection_id);
CREATE TABLE harvested_item
(
item_id INTEGER REFERENCES item(item_id) ON DELETE CASCADE,
last_harvested TIMESTAMP,
oai_id VARCHAR(64),
id INTEGER PRIMARY KEY
);
CREATE INDEX harvested_item_fk_idx ON harvested_item(item_id);

View File

@@ -81,11 +81,10 @@
@updateseq.sql tasklistitem_seq tasklistitem tasklist_id @updateseq.sql tasklistitem_seq tasklistitem tasklist_id
@updateseq.sql registrationdata_seq registrationdata registrationdata_id @updateseq.sql registrationdata_seq registrationdata registrationdata_id
@updateseq.sql subscription_seq subscription subscription_id @updateseq.sql subscription_seq subscription subscription_id
@updateseq.sql history_seq history history_id
@updateseq.sql historystate_seq historystate history_state_id
@updateseq.sql communities2item_seq communities2item id @updateseq.sql communities2item_seq communities2item id
@updateseq.sql itemsbyauthor_seq itemsbyauthor items_by_author_id
@updateseq.sql itemsbytitle_seq itemsbytitle items_by_title_id
@updateseq.sql itemsbydate_seq itemsbydate items_by_date_id
@updateseq.sql itemsbydateaccessioned_seq itemsbydateaccessioned items_by_date_accessioned_id
@updateseq.sql epersongroup2workspaceitem_seq epersongroup2workspaceitem id @updateseq.sql epersongroup2workspaceitem_seq epersongroup2workspaceitem id
@updateseq.sql metadatafieldregistry_seq metadatafieldregistry metadata_field_id
@updateseq.sql metadatavalue_seq metadatavalue metadata_value_id
@updateseq.sql metadataschemaregistry_seq metadataschemaregistry metadata_schema_id
@updateseq.sql harvested_collection_seq harvested_collection id
@updateseq.sql harvested_item_seq harvested_item id