departure 6.8.0 → 7.0.0

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.
@@ -5,6 +5,13 @@ module Departure
5
5
  extend Forwardable
6
6
 
7
7
  class << self
8
+ def version_matches?(version_string, compatibility_string = current_version::STRING)
9
+ raise "Invalid Gem Version: '#{version_string}'" unless Gem::Version.correct?(version_string)
10
+
11
+ requirement = Gem::Requirement.new(compatibility_string)
12
+ requirement.satisfied_by?(Gem::Version.new(version_string))
13
+ end
14
+
8
15
  def current_version
9
16
  ActiveRecord::VERSION
10
17
  end
@@ -14,10 +21,14 @@ module Departure
14
21
  end
15
22
 
16
23
  def for(ar_version)
17
- if ar_version::MAJOR >= 7 && ar_version::MINOR >= 2
24
+ if ar_version::MAJOR == 8
25
+ V8_0_Adapter
26
+ elsif ar_version::MAJOR >= 7 && ar_version::MINOR >= 2
18
27
  V7_2_Adapter
19
- else
28
+ elsif ar_version::MAJOR >= 6
20
29
  BaseAdapter
30
+ else
31
+ raise "Unsupported Rails version: #{ar_version}"
21
32
  end
22
33
  end
23
34
  end
@@ -102,5 +113,34 @@ module Departure
102
113
  end
103
114
  end
104
115
  end
116
+
117
+ class V8_0_Adapter < BaseAdapter # rubocop:disable Naming/ClassAndModuleCamelCase
118
+ class << self
119
+ def register_integrations
120
+ require 'active_record/connection_adapters/rails_8_0_departure_adapter'
121
+ require 'departure/rails_patches/active_record_migrator_with_advisory_lock_patch'
122
+
123
+ ActiveSupport.on_load(:active_record) do
124
+ ActiveRecord::Migration.class_eval do
125
+ include Departure::Migration
126
+ end
127
+
128
+ ActiveRecord::Migrator.prepend Departure::RailsPatches::ActiveRecordMigratorWithAdvisoryLockPatch
129
+ end
130
+
131
+ ActiveRecord::ConnectionAdapters.register 'percona',
132
+ 'ActiveRecord::ConnectionAdapters::Rails80DepartureAdapter',
133
+ 'active_record/connection_adapters/rails_8_0_departure_adapter'
134
+ end
135
+
136
+ def create_connection_adapter(**config)
137
+ ActiveRecord::ConnectionAdapters::Rails80DepartureAdapter.new(config)
138
+ end
139
+
140
+ def sql_column
141
+ ::ActiveRecord::ConnectionAdapters::Rails80DepartureAdapter::Column
142
+ end
143
+ end
144
+ end
105
145
  end
106
146
  end
@@ -11,13 +11,13 @@ module Departure
11
11
  @__original_connection = connection
12
12
 
13
13
  got_lock = @__original_connection.get_advisory_lock(lock_id)
14
- raise ConcurrentMigrationError unless got_lock
14
+ raise ActiveRecord::ConcurrentMigrationError unless got_lock
15
15
 
16
16
  load_migrated # reload schema_migrations to be sure it wasn't changed by another process before we got the lock
17
17
  yield
18
18
  ensure
19
19
  if got_lock && !@__original_connection.release_advisory_lock(lock_id)
20
- raise ConcurrentMigrationError, RELEASE_LOCK_FAILED_MESSAGE
20
+ raise ActiveRecord::ConcurrentMigrationError, RELEASE_LOCK_FAILED_MESSAGE
21
21
  end
22
22
  end
23
23
  end
@@ -22,6 +22,14 @@ module Departure
22
22
  @redirect_stderr = config&.redirect_stderr
23
23
  end
24
24
 
25
+ def query_options
26
+ raw_connection.query_options
27
+ end
28
+
29
+ def abandon_results!
30
+ raw_connection.abandon_results!
31
+ end
32
+
25
33
  def database_adapter
26
34
  @mysql_adapter
27
35
  end
@@ -1,3 +1,3 @@
1
1
  module Departure
2
- VERSION = '6.8.0'.freeze
2
+ VERSION = '7.0.0'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: departure
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.8.0
4
+ version: 7.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ilya Zayats
@@ -12,10 +12,9 @@ authors:
12
12
  - Adrian Serafin
13
13
  - Kirk Haines
14
14
  - Guillermo Iguaran
15
- autorequire:
16
15
  bindir: bin
17
16
  cert_chain: []
18
- date: 2025-03-31 00:00:00.000000000 Z
17
+ date: 2025-08-27 00:00:00.000000000 Z
19
18
  dependencies:
20
19
  - !ruby/object:Gem::Dependency
21
20
  name: railties
@@ -23,52 +22,28 @@ dependencies:
23
22
  requirements:
24
23
  - - ">="
25
24
  - !ruby/object:Gem::Version
26
- version: 6.0.0
27
- - - "!="
28
- - !ruby/object:Gem::Version
29
- version: 7.0.0
30
- - - "<"
31
- - !ruby/object:Gem::Version
32
- version: 7.3.0
25
+ version: 7.0.1
33
26
  type: :runtime
34
27
  prerelease: false
35
28
  version_requirements: !ruby/object:Gem::Requirement
36
29
  requirements:
37
30
  - - ">="
38
31
  - !ruby/object:Gem::Version
39
- version: 6.0.0
40
- - - "!="
41
- - !ruby/object:Gem::Version
42
- version: 7.0.0
43
- - - "<"
44
- - !ruby/object:Gem::Version
45
- version: 7.3.0
32
+ version: 7.0.1
46
33
  - !ruby/object:Gem::Dependency
47
34
  name: activerecord
48
35
  requirement: !ruby/object:Gem::Requirement
49
36
  requirements:
50
37
  - - ">="
51
38
  - !ruby/object:Gem::Version
52
- version: 6.0.0
53
- - - "!="
54
- - !ruby/object:Gem::Version
55
- version: 7.0.0
56
- - - "<"
57
- - !ruby/object:Gem::Version
58
- version: 7.3.0
39
+ version: 7.0.1
59
40
  type: :runtime
60
41
  prerelease: false
61
42
  version_requirements: !ruby/object:Gem::Requirement
62
43
  requirements:
63
44
  - - ">="
64
45
  - !ruby/object:Gem::Version
65
- version: 6.0.0
66
- - - "!="
67
- - !ruby/object:Gem::Version
68
- version: 7.0.0
69
- - - "<"
70
- - !ruby/object:Gem::Version
71
- version: 7.3.0
46
+ version: 7.0.1
72
47
  - !ruby/object:Gem::Dependency
73
48
  name: mysql2
74
49
  requirement: !ruby/object:Gem::Requirement
@@ -218,18 +193,19 @@ files:
218
193
  - configuration.rb
219
194
  - departure.gemspec
220
195
  - docker-compose.yml
221
- - gemfiles/rails_6_1.gemfile
222
- - gemfiles/rails_6_1.gemfile.lock
223
196
  - gemfiles/rails_7_0.gemfile
224
197
  - gemfiles/rails_7_0.gemfile.lock
225
198
  - gemfiles/rails_7_1.gemfile
226
199
  - gemfiles/rails_7_1.gemfile.lock
227
200
  - gemfiles/rails_7_2.gemfile
228
201
  - gemfiles/rails_7_2.gemfile.lock
202
+ - gemfiles/rails_8_0.gemfile
203
+ - gemfiles/rails_8_0.gemfile.lock
229
204
  - lib/active_record/connection_adapters/for_alter.rb
230
205
  - lib/active_record/connection_adapters/patch_connection_handling.rb
231
206
  - lib/active_record/connection_adapters/percona_adapter.rb
232
207
  - lib/active_record/connection_adapters/rails_7_2_departure_adapter.rb
208
+ - lib/active_record/connection_adapters/rails_8_0_departure_adapter.rb
233
209
  - lib/departure.rb
234
210
  - lib/departure/alter_argument.rb
235
211
  - lib/departure/cli_generator.rb
@@ -260,7 +236,6 @@ homepage: https://github.com/departurerb/departure
260
236
  licenses:
261
237
  - MIT
262
238
  metadata: {}
263
- post_install_message:
264
239
  rdoc_options: []
265
240
  require_paths:
266
241
  - lib
@@ -268,15 +243,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
268
243
  requirements:
269
244
  - - ">="
270
245
  - !ruby/object:Gem::Version
271
- version: 2.7.0
246
+ version: 3.2.0
272
247
  required_rubygems_version: !ruby/object:Gem::Requirement
273
248
  requirements:
274
249
  - - ">="
275
250
  - !ruby/object:Gem::Version
276
251
  version: '0'
277
252
  requirements: []
278
- rubygems_version: 3.5.23
279
- signing_key:
253
+ rubygems_version: 3.6.2
280
254
  specification_version: 4
281
255
  summary: pt-online-schema-change runner for ActiveRecord migrations
282
256
  test_files: []
@@ -1,243 +0,0 @@
1
- PATH
2
- remote: ..
3
- specs:
4
- departure (6.7.0)
5
- activerecord (>= 6.0.0, < 7.3.0, != 7.0.0)
6
- mysql2 (>= 0.4.0, < 0.6.0)
7
- railties (>= 6.0.0, < 7.3.0, != 7.0.0)
8
-
9
- GEM
10
- remote: https://rubygems.org/
11
- specs:
12
- actioncable (6.1.7.6)
13
- actionpack (= 6.1.7.6)
14
- activesupport (= 6.1.7.6)
15
- nio4r (~> 2.0)
16
- websocket-driver (>= 0.6.1)
17
- actionmailbox (6.1.7.6)
18
- actionpack (= 6.1.7.6)
19
- activejob (= 6.1.7.6)
20
- activerecord (= 6.1.7.6)
21
- activestorage (= 6.1.7.6)
22
- activesupport (= 6.1.7.6)
23
- mail (>= 2.7.1)
24
- actionmailer (6.1.7.6)
25
- actionpack (= 6.1.7.6)
26
- actionview (= 6.1.7.6)
27
- activejob (= 6.1.7.6)
28
- activesupport (= 6.1.7.6)
29
- mail (~> 2.5, >= 2.5.4)
30
- rails-dom-testing (~> 2.0)
31
- actionpack (6.1.7.6)
32
- actionview (= 6.1.7.6)
33
- activesupport (= 6.1.7.6)
34
- rack (~> 2.0, >= 2.0.9)
35
- rack-test (>= 0.6.3)
36
- rails-dom-testing (~> 2.0)
37
- rails-html-sanitizer (~> 1.0, >= 1.2.0)
38
- actiontext (6.1.7.6)
39
- actionpack (= 6.1.7.6)
40
- activerecord (= 6.1.7.6)
41
- activestorage (= 6.1.7.6)
42
- activesupport (= 6.1.7.6)
43
- nokogiri (>= 1.8.5)
44
- actionview (6.1.7.6)
45
- activesupport (= 6.1.7.6)
46
- builder (~> 3.1)
47
- erubi (~> 1.4)
48
- rails-dom-testing (~> 2.0)
49
- rails-html-sanitizer (~> 1.1, >= 1.2.0)
50
- activejob (6.1.7.6)
51
- activesupport (= 6.1.7.6)
52
- globalid (>= 0.3.6)
53
- activemodel (6.1.7.6)
54
- activesupport (= 6.1.7.6)
55
- activerecord (6.1.7.6)
56
- activemodel (= 6.1.7.6)
57
- activesupport (= 6.1.7.6)
58
- activestorage (6.1.7.6)
59
- actionpack (= 6.1.7.6)
60
- activejob (= 6.1.7.6)
61
- activerecord (= 6.1.7.6)
62
- activesupport (= 6.1.7.6)
63
- marcel (~> 1.0)
64
- mini_mime (>= 1.1.0)
65
- activesupport (6.1.7.6)
66
- concurrent-ruby (~> 1.0, >= 1.0.2)
67
- i18n (>= 1.6, < 2)
68
- minitest (>= 5.1)
69
- tzinfo (~> 2.0)
70
- zeitwerk (~> 2.3)
71
- appraisal (2.4.1)
72
- bundler
73
- rake
74
- thor (>= 0.14.0)
75
- ast (2.4.2)
76
- builder (3.3.0)
77
- byebug (11.1.3)
78
- climate_control (0.0.4)
79
- activesupport (>= 3.0)
80
- codeclimate-test-reporter (1.0.9)
81
- simplecov (<= 0.13)
82
- coderay (1.1.3)
83
- concurrent-ruby (1.3.3)
84
- crass (1.0.6)
85
- date (3.3.4)
86
- diff-lcs (1.5.1)
87
- docile (1.1.5)
88
- erubi (1.13.0)
89
- globalid (1.2.1)
90
- activesupport (>= 6.1)
91
- i18n (1.14.5)
92
- concurrent-ruby (~> 1.0)
93
- json (2.7.2)
94
- language_server-protocol (3.17.0.3)
95
- loofah (2.22.0)
96
- crass (~> 1.0.2)
97
- nokogiri (>= 1.12.0)
98
- mail (2.8.1)
99
- mini_mime (>= 0.1.1)
100
- net-imap
101
- net-pop
102
- net-smtp
103
- marcel (1.0.4)
104
- method_source (1.1.0)
105
- mini_mime (1.1.5)
106
- minitest (5.24.1)
107
- mysql2 (0.5.6)
108
- net-imap (0.4.12)
109
- date
110
- net-protocol
111
- net-pop (0.1.2)
112
- net-protocol
113
- net-protocol (0.2.2)
114
- timeout
115
- net-smtp (0.5.0)
116
- net-protocol
117
- nio4r (2.7.3)
118
- nokogiri (1.18.3-arm64-darwin)
119
- racc (~> 1.4)
120
- nokogiri (1.18.3-x86_64-linux-gnu)
121
- racc (~> 1.4)
122
- parallel (1.25.1)
123
- parser (3.3.3.0)
124
- ast (~> 2.4.1)
125
- racc
126
- pry (0.14.2)
127
- coderay (~> 1.1)
128
- method_source (~> 1.0)
129
- pry-byebug (3.10.1)
130
- byebug (~> 11.0)
131
- pry (>= 0.13, < 0.15)
132
- racc (1.8.0)
133
- rack (2.2.9)
134
- rack-test (2.1.0)
135
- rack (>= 1.3)
136
- rails (6.1.7.6)
137
- actioncable (= 6.1.7.6)
138
- actionmailbox (= 6.1.7.6)
139
- actionmailer (= 6.1.7.6)
140
- actionpack (= 6.1.7.6)
141
- actiontext (= 6.1.7.6)
142
- actionview (= 6.1.7.6)
143
- activejob (= 6.1.7.6)
144
- activemodel (= 6.1.7.6)
145
- activerecord (= 6.1.7.6)
146
- activestorage (= 6.1.7.6)
147
- activesupport (= 6.1.7.6)
148
- bundler (>= 1.15.0)
149
- railties (= 6.1.7.6)
150
- sprockets-rails (>= 2.0.0)
151
- rails-dom-testing (2.2.0)
152
- activesupport (>= 5.0.0)
153
- minitest
154
- nokogiri (>= 1.6)
155
- rails-html-sanitizer (1.6.0)
156
- loofah (~> 2.21)
157
- nokogiri (~> 1.14)
158
- railties (6.1.7.6)
159
- actionpack (= 6.1.7.6)
160
- activesupport (= 6.1.7.6)
161
- method_source
162
- rake (>= 12.2)
163
- thor (~> 1.0)
164
- rainbow (3.1.1)
165
- rake (13.2.1)
166
- regexp_parser (2.9.2)
167
- rexml (3.3.0)
168
- strscan
169
- rspec (3.13.0)
170
- rspec-core (~> 3.13.0)
171
- rspec-expectations (~> 3.13.0)
172
- rspec-mocks (~> 3.13.0)
173
- rspec-core (3.13.0)
174
- rspec-support (~> 3.13.0)
175
- rspec-expectations (3.13.1)
176
- diff-lcs (>= 1.2.0, < 2.0)
177
- rspec-support (~> 3.13.0)
178
- rspec-its (1.3.0)
179
- rspec-core (>= 3.0.0)
180
- rspec-expectations (>= 3.0.0)
181
- rspec-mocks (3.13.1)
182
- diff-lcs (>= 1.2.0, < 2.0)
183
- rspec-support (~> 3.13.0)
184
- rspec-support (3.13.1)
185
- rubocop (1.60.2)
186
- json (~> 2.3)
187
- language_server-protocol (>= 3.17.0)
188
- parallel (~> 1.10)
189
- parser (>= 3.3.0.2)
190
- rainbow (>= 2.2.2, < 4.0)
191
- regexp_parser (>= 1.8, < 3.0)
192
- rexml (>= 3.2.5, < 4.0)
193
- rubocop-ast (>= 1.30.0, < 2.0)
194
- ruby-progressbar (~> 1.7)
195
- unicode-display_width (>= 2.4.0, < 3.0)
196
- rubocop-ast (1.31.3)
197
- parser (>= 3.3.1.0)
198
- rubocop-performance (1.20.2)
199
- rubocop (>= 1.48.1, < 2.0)
200
- rubocop-ast (>= 1.30.0, < 2.0)
201
- ruby-progressbar (1.13.0)
202
- simplecov (0.13.0)
203
- docile (~> 1.1.0)
204
- json (>= 1.8, < 3)
205
- simplecov-html (~> 0.10.0)
206
- simplecov-html (0.10.2)
207
- sprockets (4.2.1)
208
- concurrent-ruby (~> 1.0)
209
- rack (>= 2.2.4, < 4)
210
- sprockets-rails (3.4.2)
211
- actionpack (>= 5.2)
212
- activesupport (>= 5.2)
213
- sprockets (>= 3.0.0)
214
- strscan (3.1.0)
215
- thor (1.3.1)
216
- timeout (0.4.1)
217
- tzinfo (2.0.6)
218
- concurrent-ruby (~> 1.0)
219
- unicode-display_width (2.5.0)
220
- websocket-driver (0.7.6)
221
- websocket-extensions (>= 0.1.0)
222
- websocket-extensions (0.1.5)
223
- zeitwerk (2.6.16)
224
-
225
- PLATFORMS
226
- arm64-darwin-23
227
- x86_64-linux
228
-
229
- DEPENDENCIES
230
- appraisal (~> 2.4.1)
231
- climate_control (~> 0.0.3)
232
- codeclimate-test-reporter (~> 1.0.3)
233
- departure!
234
- pry-byebug
235
- rails (= 6.1.7.6)
236
- rake (>= 10.0)
237
- rspec (~> 3.4, >= 3.4.0)
238
- rspec-its (~> 1.2)
239
- rubocop (~> 1.60.2)
240
- rubocop-performance (~> 1.20.2)
241
-
242
- BUNDLED WITH
243
- 2.4.22