More fixes for Oracle. Cannot update sequences mid-upgrade. Will create a post-upgrade script for sequence updates

This commit is contained in:
Tim Donohue
2014-10-29 14:13:30 -05:00
parent 9f4c030fed
commit 37351c5391
3 changed files with 0 additions and 39 deletions

View File

@@ -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

View File

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

View File

@@ -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;
/