From bd3a449c5997a2bc2a2443c91f7c44c27c524fe8 Mon Sep 17 00:00:00 2001 From: Jeremy Croteau Date: Thu, 24 Aug 2023 18:07:42 -0400 Subject: [PATCH] :wrench: Add configuration to preserve pre-existing behavior of 'activerecord-oracle_enhanced-adapter' oracle-enhanced v6.00 changes the default sequence start value from 10,000 to 1: Release Notes: https://github.com/rsim/oracle-enhanced/blob/v6.0.6/History.md#600--2019-08-17 Related PR: https://github.com/rsim/oracle-enhanced/pull/1636 Preserve the original default value of 10,000 --- config/initializers/oracle.rb | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 config/initializers/oracle.rb diff --git a/config/initializers/oracle.rb b/config/initializers/oracle.rb new file mode 100644 index 00000000000..0cfe7b22319 --- /dev/null +++ b/config/initializers/oracle.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +ActiveSupport.on_load(:active_record) do + ActiveRecord::ConnectionAdapters::OracleEnhancedAdapter.class_eval do + # oracle-enhanced v6.00 changes the default sequence start value from 10,000 to 1: + # Release Notes: https://github.com/rsim/oracle-enhanced/blob/v6.0.6/History.md#600--2019-08-17 + # Related PR: https://github.com/rsim/oracle-enhanced/pull/1636 + # + # Preserve the original default value of 10,000 + self.default_sequence_start_value = 10_000 + end +end