mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-07 01:54:22 +00:00
More fixes for Oracle. Cannot update sequences mid-upgrade. Will create a post-upgrade script for sequence updates
This commit is contained in:
@@ -104,12 +104,6 @@ CREATE VIEW dcvalue AS
|
||||
WHERE MetadataValue.metadata_field_id = MetadataFieldRegistry.metadata_field_id
|
||||
AND MetadataFieldRegistry.metadata_schema_id = 1;
|
||||
|
||||
|
||||
-- CANNOT EASILY RESET SEQUENCES IN H2
|
||||
-- @updateseq.sql metadatafieldregistry_seq metadatafieldregistry metadata_field_id;
|
||||
-- @updateseq.sql metadatavalue_seq metadatavalue metadata_value_id;
|
||||
-- @updateseq.sql metadataschemaregistry_seq metadataschemaregistry metadata_schema_id;
|
||||
|
||||
DROP TABLE dctyperegistry;
|
||||
|
||||
-- create indexes for the metadata tables
|
||||
|
@@ -103,9 +103,6 @@ CREATE VIEW dcvalue AS
|
||||
WHERE MetadataValue.metadata_field_id = MetadataFieldRegistry.metadata_field_id
|
||||
AND MetadataFieldRegistry.metadata_schema_id = 1;
|
||||
|
||||
@updateseq.sql metadatafieldregistry_seq metadatafieldregistry metadata_field_id;
|
||||
@updateseq.sql metadatavalue_seq metadatavalue metadata_value_id;
|
||||
@updateseq.sql metadataschemaregistry_seq metadataschemaregistry metadata_schema_id;
|
||||
|
||||
DROP TABLE dctyperegistry;
|
||||
|
||||
|
@@ -1,30 +0,0 @@
|
||||
-- #############################################################################################
|
||||
--
|
||||
-- %Purpose: Set a sequence to the max value of a given attribute
|
||||
--
|
||||
-- #############################################################################################
|
||||
--
|
||||
-- Paramters:
|
||||
-- 1: sequence name
|
||||
-- 2: table name
|
||||
-- 3: attribute name
|
||||
--
|
||||
-- Sample usage:
|
||||
-- @updateseq.sql my_sequence my_table my_attribute where-clause
|
||||
--
|
||||
--------------------------------------------------------------------------------
|
||||
--
|
||||
SET SERVEROUTPUT ON SIZE 1000000;
|
||||
--
|
||||
DECLARE
|
||||
curr NUMBER := 0;
|
||||
BEGIN
|
||||
SELECT max(&3) INTO curr FROM &2 &4;
|
||||
|
||||
curr := curr + 1;
|
||||
|
||||
EXECUTE IMMEDIATE 'DROP SEQUENCE &1';
|
||||
|
||||
EXECUTE IMMEDIATE 'CREATE SEQUENCE &1 START WITH ' || NVL(curr,1);
|
||||
END;
|
||||
/
|
Reference in New Issue
Block a user