activerecord-oracle_enhanced-adapter 7.1.0 → 7.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2c54d072a9a65f5b91b230da739c0b2f117d397813b9f2dfb0ca56c13da00979
4
- data.tar.gz: 0b4e805aff8d23258dda658e70a87494cb93d6da7b5e0024bd74a3807f54295e
3
+ metadata.gz: acf9205c3bd6ee30bd105a8166789a7f7aa34ce9699405bfc8b174c016c55113
4
+ data.tar.gz: 3716edcbc87b8a8ecd55cb556706637cd038b7a10084235852fe91615c4ba6b2
5
5
  SHA512:
6
- metadata.gz: 72464c92eb71576aae495a2e93674d6823e1a2967f7f8bc45116d14dfbe8f29291c71b7f122e83c74698834be25e729bfddc0b64baf23de7e1b26044960faf26
7
- data.tar.gz: 165de73dc654f318d7dc3042ae10f669047733255decd38f9abb2c3db3522bbb6f4c471db44a1ffe40ebaab05b400f9cd2eede381ea1018ea28217529a1c7610
6
+ metadata.gz: 0a2a11722e534f9079995f462879d2592fc0df483e833dc4765f3df7c2fec0345a823cf2390b60a60a7c056ee31c503088fcf0342eeb02fa1e233c162926924b
7
+ data.tar.gz: 6c7a89267b1f9747c7bed9251f0d234eaaa1825be8d5efdf93566906c49d0258cd94a94354732b3381df195527b37a7d0fcf575b4ca4b46de6784cc6dd86cbfc
data/History.md CHANGED
@@ -1,3 +1,11 @@
1
+ ## 7.1.1 / 2025-06-16
2
+
3
+ * Changes and bug fixes
4
+ * Address `add_timestamps` error [#2417, #2438]
5
+ * Address `rename_table` ArgumentError [#2418, #2437]
6
+ * Update `reconnect!` method signature [#2433, #2436]
7
+ * Update README.md to support status of Rails 7.1 [#2408, #2409]
8
+
1
9
  ## 7.1.0 / 2024-09-25
2
10
 
3
11
  * Changes and bug fixes
data/README.md CHANGED
@@ -6,10 +6,20 @@ Oracle enhanced adapter for ActiveRecord
6
6
  DESCRIPTION
7
7
  -----------
8
8
 
9
- Oracle enhanced ActiveRecord adapter provides Oracle database access from Ruby on Rails applications. Oracle enhanced adapter can be used from Ruby on Rails versions between 2.3.x and 7.0 and it is working with Oracle database versions 10g and higher
9
+ Oracle enhanced ActiveRecord adapter provides Oracle database access from Ruby on Rails applications. Oracle enhanced adapter can be used from Ruby on Rails versions between 2.3.x and 7.1 and it is working with Oracle database versions 10g and higher
10
10
 
11
11
  INSTALLATION
12
12
  ------------
13
+ ### Rails 7.1
14
+
15
+ Oracle enhanced adapter version 7.1 supports Rails 7.1
16
+ When using Ruby on Rails version 7.1 then in Gemfile include
17
+
18
+ ```ruby
19
+ # Use oracle as the database for Active Record
20
+ gem 'activerecord-oracle_enhanced-adapter', '~> 7.1.0'
21
+ ```
22
+
13
23
  ### Rails 7.0
14
24
 
15
25
  Oracle enhanced adapter version 7.0 supports Rails 7.0
data/VERSION CHANGED
@@ -1 +1 @@
1
- 7.1.0
1
+ 7.1.1
@@ -252,7 +252,7 @@ module ActiveRecord
252
252
  rebuild_primary_key_index_to_default_tablespace(table_name, options)
253
253
  end
254
254
 
255
- def rename_table(table_name, new_name) # :nodoc:
255
+ def rename_table(table_name, new_name, **options) # :nodoc:
256
256
  if new_name.to_s.length > DatabaseLimits::IDENTIFIER_MAX_LENGTH
257
257
  raise ArgumentError, "New table name '#{new_name}' is too long; the limit is #{DatabaseLimits::IDENTIFIER_MAX_LENGTH} characters"
258
258
  end
@@ -261,7 +261,7 @@ module ActiveRecord
261
261
  execute "RENAME #{quote_table_name(table_name)} TO #{quote_table_name(new_name)}"
262
262
  execute "RENAME #{quote_table_name("#{table_name}_seq")} TO #{default_sequence_name(new_name)}" rescue nil
263
263
 
264
- rename_table_indexes(table_name, new_name)
264
+ rename_table_indexes(table_name, new_name, **options)
265
265
  end
266
266
 
267
267
  def drop_table(table_name, **options) # :nodoc:
@@ -622,6 +622,13 @@ module ActiveRecord
622
622
  OracleEnhanced::AlterTable.new create_table_definition(name)
623
623
  end
624
624
 
625
+ def add_timestamps(table_name, **options)
626
+ fragments = add_timestamps_for_alter(table_name, **options)
627
+ fragments.each do |fragment|
628
+ execute "ALTER TABLE #{quote_table_name(table_name)} #{fragment}"
629
+ end
630
+ end
631
+
625
632
  def update_table_definition(table_name, base)
626
633
  OracleEnhanced::Table.new(table_name, base)
627
634
  end
@@ -467,7 +467,7 @@ module ActiveRecord
467
467
  end
468
468
 
469
469
  # Reconnects to the database.
470
- def reconnect! # :nodoc:
470
+ def reconnect!(restore_transactions: false) # :nodoc:
471
471
  super
472
472
  _connection.reset!
473
473
  rescue OracleEnhanced::ConnectionException => e
@@ -0,0 +1,36 @@
1
+ # frozen_string_literal: true
2
+
3
+ describe "compatibility migrations" do
4
+ include SchemaSpecHelper
5
+
6
+ before(:all) do
7
+ ActiveRecord::Base.establish_connection(CONNECTION_PARAMS)
8
+ @conn = ActiveRecord::Base.connection
9
+ schema_define do
10
+ create_table :test_employees, force: true
11
+ end
12
+ end
13
+
14
+ after(:all) do
15
+ schema_define do
16
+ drop_table :test_employees, if_exists: true
17
+ drop_table :new_test_employees, if_exists: true
18
+ end
19
+ end
20
+
21
+ it "should rename table on 7_0 and below" do
22
+ migration = Class.new(ActiveRecord::Migration[7.0]) {
23
+ def change
24
+ rename_table :test_employees, :new_test_employees
25
+ end
26
+ }.new
27
+
28
+ migration.migrate(:up)
29
+ expect(@conn.table_exists?(:new_test_employees)).to be_truthy
30
+ expect(@conn.table_exists?(:test_employees)).not_to be_truthy
31
+
32
+ migration.migrate(:down)
33
+ expect(@conn.table_exists?(:new_test_employees)).not_to be_truthy
34
+ expect(@conn.table_exists?(:test_employees)).to be_truthy
35
+ end
36
+ end
@@ -30,6 +30,12 @@ describe "OracleEnhancedAdapter establish connection" do
30
30
  expect(ActiveRecord::Base.connection).to be_active
31
31
  end
32
32
 
33
+ it "should be active after reconnection to database with restore_transactions: true" do
34
+ ActiveRecord::Base.establish_connection(CONNECTION_PARAMS)
35
+ ActiveRecord::Base.connection.reconnect!(restore_transactions: true)
36
+ expect(ActiveRecord::Base.connection).to be_active
37
+ end
38
+
33
39
  it "should use database default cursor_sharing parameter value force by default" do
34
40
  # Use `SYSTEM_CONNECTION_PARAMS` to query v$parameter
35
41
  ActiveRecord::Base.establish_connection(SYSTEM_CONNECTION_PARAMS)
@@ -387,6 +387,34 @@ describe "OracleEnhancedAdapter schema definition" do
387
387
  end
388
388
  end
389
389
 
390
+ describe "add timestamps" do
391
+ before(:each) do
392
+ @conn = ActiveRecord::Base.connection
393
+ schema_define do
394
+ create_table :test_employees, force: true
395
+ end
396
+ class ::TestEmployee < ActiveRecord::Base; end
397
+ end
398
+
399
+ after(:each) do
400
+ schema_define do
401
+ drop_table :test_employees, if_exists: true
402
+ end
403
+ Object.send(:remove_const, "TestEmployee")
404
+ ActiveRecord::Base.clear_cache!
405
+ end
406
+
407
+ it "should add created_at and updated_at" do
408
+ expect do
409
+ @conn.add_timestamps("test_employees")
410
+ end.not_to raise_error
411
+
412
+ TestEmployee.reset_column_information
413
+ expect(TestEmployee.columns_hash["created_at"]).not_to be_nil
414
+ expect(TestEmployee.columns_hash["updated_at"]).not_to be_nil
415
+ end
416
+ end
417
+
390
418
  describe "ignore options for LOB columns" do
391
419
  after(:each) do
392
420
  schema_define do
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activerecord-oracle_enhanced-adapter
3
3
  version: !ruby/object:Gem::Version
4
- version: 7.1.0
4
+ version: 7.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Raimonds Simanovskis
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2024-09-25 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: activerecord
@@ -104,6 +103,7 @@ files:
104
103
  - lib/arel/visitors/oracle12.rb
105
104
  - lib/arel/visitors/oracle_common.rb
106
105
  - spec/active_record/connection_adapters/emulation/oracle_adapter_spec.rb
106
+ - spec/active_record/connection_adapters/oracle_enhanced/compatibility_spec.rb
107
107
  - spec/active_record/connection_adapters/oracle_enhanced/connection_spec.rb
108
108
  - spec/active_record/connection_adapters/oracle_enhanced/context_index_spec.rb
109
109
  - spec/active_record/connection_adapters/oracle_enhanced/database_tasks_spec.rb
@@ -139,7 +139,6 @@ licenses:
139
139
  - MIT
140
140
  metadata:
141
141
  rubygems_mfa_required: 'true'
142
- post_install_message:
143
142
  rdoc_options: []
144
143
  require_paths:
145
144
  - lib
@@ -154,12 +153,12 @@ required_rubygems_version: !ruby/object:Gem::Requirement
154
153
  - !ruby/object:Gem::Version
155
154
  version: 1.8.11
156
155
  requirements: []
157
- rubygems_version: 3.5.16
158
- signing_key:
156
+ rubygems_version: 3.6.7
159
157
  specification_version: 4
160
158
  summary: Oracle enhanced adapter for ActiveRecord
161
159
  test_files:
162
160
  - spec/active_record/connection_adapters/emulation/oracle_adapter_spec.rb
161
+ - spec/active_record/connection_adapters/oracle_enhanced/compatibility_spec.rb
163
162
  - spec/active_record/connection_adapters/oracle_enhanced/connection_spec.rb
164
163
  - spec/active_record/connection_adapters/oracle_enhanced/context_index_spec.rb
165
164
  - spec/active_record/connection_adapters/oracle_enhanced/database_tasks_spec.rb