From 50f1f19d0cbded19c4c254aea52cc439ff6c6fbc Mon Sep 17 00:00:00 2001 From: Hardy Pottinger Date: Tue, 27 Nov 2012 02:00:05 -0600 Subject: [PATCH] DS-1370 revise SQL scripts to deal with various Oracle issues, also add missing tables and sequences to clean-database.sql --- dspace/etc/clean-database.sql | 5 +++++ dspace/etc/oracle/ORACLE_README.txt | 5 +++++ dspace/etc/oracle/database_schema.sql | 6 ------ 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/dspace/etc/clean-database.sql b/dspace/etc/clean-database.sql index 2978452cd0..5c211bc2c1 100644 --- a/dspace/etc/clean-database.sql +++ b/dspace/etc/clean-database.sql @@ -80,6 +80,8 @@ DROP TABLE Group2GroupCache; DROP TABLE Group2Group; DROP TABLE FileExtension; -- Drop main object tables near end as many other tables have dependencies on them +DROP TABLE versionitem; +DROP TABLE versionhistory; DROP TABLE Community; DROP TABLE Collection; DROP TABLE Item; @@ -96,6 +98,7 @@ DROP TABLE EPerson; DROP SEQUENCE bitstreamformatregistry_seq; DROP SEQUENCE fileextension_seq; DROP SEQUENCE bitstream_seq; +DROP SEQUENCE checksum_history_seq; DROP SEQUENCE eperson_seq; DROP SEQUENCE epersongroup_seq; DROP SEQUENCE item_seq; @@ -125,6 +128,8 @@ DROP SEQUENCE group2group_seq; DROP SEQUENCE group2groupcache_seq; DROP SEQUENCE harvested_collection_seq; DROP SEQUENCE harvested_item_seq; +DROP SEQUENCE versionhistory_seq; +DROP SEQUENCE versionitem_seq; -- Drop the getnextid() function DROP FUNCTION getnextid(VARCHAR(40)); diff --git a/dspace/etc/oracle/ORACLE_README.txt b/dspace/etc/oracle/ORACLE_README.txt index 4eddf0fdb4..93be5aaceb 100644 --- a/dspace/etc/oracle/ORACLE_README.txt +++ b/dspace/etc/oracle/ORACLE_README.txt @@ -59,3 +59,8 @@ JDBC driver is reporting INTEGERS as type DECIMAL. Oracle doesn't like it when you reference table names in lower case when getting JDBC metadata for the tables, so they are converted in TableRow to upper case. + +==UPDATE 27 November 2012== +Oracle complains with ORA-01408 if you attempt to create an index on a column which +has already had the UNIQUE contraint added (such an index is implicit in maintaining the uniqueness +of the column). See DS-1370 for details. diff --git a/dspace/etc/oracle/database_schema.sql b/dspace/etc/oracle/database_schema.sql index 10cac830e0..0915e98b2a 100644 --- a/dspace/etc/oracle/database_schema.sql +++ b/dspace/etc/oracle/database_schema.sql @@ -143,12 +143,6 @@ CREATE TABLE EPerson language VARCHAR2(64) ); --- index by email -CREATE INDEX eperson_email_idx ON EPerson(email); - --- index by netid -CREATE INDEX eperson_netid_idx ON EPerson(netid); - ------------------------------------------------------- -- EPersonGroup table -------------------------------------------------------