departure 6.8.0 → 8.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.
Files changed (38) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/test.yml +5 -6
  3. data/.rubocop.yml +1 -1
  4. data/Appraisals +8 -10
  5. data/CHANGELOG.md +15 -1
  6. data/Dockerfile +4 -11
  7. data/Gemfile +1 -0
  8. data/Gemfile.lock +91 -75
  9. data/README.md +102 -0
  10. data/Rakefile +1 -0
  11. data/config.yml.erb +8 -4
  12. data/departure.gemspec +4 -4
  13. data/docker-compose.yml +4 -0
  14. data/gemfiles/rails_7_2.gemfile +12 -6
  15. data/gemfiles/rails_7_2.gemfile.lock +96 -59
  16. data/gemfiles/rails_8_0.gemfile +16 -0
  17. data/gemfiles/rails_8_0.gemfile.lock +314 -0
  18. data/gemfiles/rails_8_1.gemfile +15 -0
  19. data/gemfiles/rails_8_1.gemfile.lock +316 -0
  20. data/lib/active_record/connection_adapters/for_alter.rb +4 -17
  21. data/lib/active_record/connection_adapters/rails_8_0_departure_adapter.rb +297 -0
  22. data/lib/active_record/connection_adapters/rails_8_1_departure_adapter.rb +83 -0
  23. data/lib/departure/db_client.rb +52 -0
  24. data/lib/departure/migration.rb +1 -5
  25. data/lib/departure/rails_adapter.rb +99 -39
  26. data/lib/departure/rails_patches/active_record_migrator_with_advisory_lock_patch.rb +2 -2
  27. data/lib/departure/runner.rb +14 -1
  28. data/lib/departure/version.rb +1 -1
  29. data/lib/departure.rb +1 -0
  30. data/lib/lhm/column_with_sql.rb +6 -5
  31. metadata +17 -44
  32. data/gemfiles/rails_6_1.gemfile +0 -10
  33. data/gemfiles/rails_6_1.gemfile.lock +0 -243
  34. data/gemfiles/rails_7_0.gemfile +0 -10
  35. data/gemfiles/rails_7_0.gemfile.lock +0 -242
  36. data/gemfiles/rails_7_1.gemfile +0 -10
  37. data/gemfiles/rails_7_1.gemfile.lock +0 -274
  38. data/lib/active_record/connection_adapters/percona_adapter.rb +0 -186
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b991b602a5feeb6029d82822b62a5b2ca7227699b225c3ab8443fc7fdb5e2bcd
4
- data.tar.gz: 43dee3946ee250402d17158ab5ca8c1e9e8ad92325917273454c049e473ddf2d
3
+ metadata.gz: f073be830cc9193469fb3d31d99ce910ac32ab2de6838f8ee18fd30e1b5a4f26
4
+ data.tar.gz: beaffddbe848d268c6a83051c7b98e294ae06ae489111a8038aed3d836febffd
5
5
  SHA512:
6
- metadata.gz: dda1f7c047249d7c74b5eecf45ed921fc738d73a789dd05a7b6b7f4ab5cac5ce6772f674b8c2072fb287fbaa3f1626f73884a19d7ded320728ca129e0ecb7b65
7
- data.tar.gz: 9401df780b63d76dec3d1068ade5720871a0fba8d8c002e1fd03b91e58dd2a6f6251511fa918e15c224c6954e278c0acac3e3ce98602cc7a162b74836eb096ef
6
+ metadata.gz: 37730fd17a593c457fd02060f1bdf07f8c2feb8c9e9e2ad8bb2e3820c38943b0761efb3ee49b9d6fd2d6dc77949b7f9d2c9d784e12556c0826e7462374a128d1
7
+ data.tar.gz: 24dff29fd1900e9fd555edd491e1f6715548ca04ce9b7dce0a455e935c07790a6b9ecd8fad52e68fec51834df51c87057b9f937d741159503d73d32c40f3207a
@@ -8,14 +8,13 @@ jobs:
8
8
  fail-fast: false
9
9
  matrix:
10
10
  ruby:
11
- - 3.1
12
11
  - 3.2
13
12
  - 3.3
13
+ - 3.4
14
14
  gemfile:
15
- - gemfiles/rails_6_1.gemfile
16
- - gemfiles/rails_7_0.gemfile
17
- - gemfiles/rails_7_1.gemfile
18
15
  - gemfiles/rails_7_2.gemfile
16
+ - gemfiles/rails_8_0.gemfile
17
+ - gemfiles/rails_8_1.gemfile
19
18
  env:
20
19
  PERCONA_DB_USER: root
21
20
  PERCONA_DB_PASSWORD: root
@@ -43,12 +42,12 @@ jobs:
43
42
  env:
44
43
  PERCONA_DB_USER: root
45
44
  PERCONA_DB_PASSWORD: root
46
- BUNDLE_GEMFILE: gemfiles/rails_7_1.gemfile
45
+ BUNDLE_GEMFILE: gemfiles/rails_8_1.gemfile
47
46
  runs-on: ubuntu-latest
48
47
  steps:
49
48
  - uses: actions/checkout@v4
50
49
  - uses: ruby/setup-ruby@v1
51
50
  with:
52
- ruby-version: 3.3
51
+ ruby-version: 3.4
53
52
  bundler-cache: true
54
53
  - run: bundle exec rubocop --parallel
data/.rubocop.yml CHANGED
@@ -6,7 +6,7 @@ require:
6
6
  - rubocop-performance
7
7
 
8
8
  AllCops:
9
- TargetRubyVersion: 3.1.x
9
+ TargetRubyVersion: 3.4.x
10
10
 
11
11
  Metrics/AbcSize:
12
12
  Enabled: false
data/Appraisals CHANGED
@@ -1,15 +1,13 @@
1
- appraise 'rails-6-1' do
2
- gem 'rails', '6.1.7.6'
3
- end
4
-
5
- appraise 'rails-7-0' do
6
- gem 'rails', '7.0.8'
1
+ appraise 'rails-7-2' do
2
+ gem 'bigdecimal'
3
+ gem 'rails', '7.2.2.1'
7
4
  end
8
5
 
9
- appraise 'rails-7-1' do
10
- gem 'rails', '7.1.3'
6
+ appraise 'rails-8-0' do
7
+ gem 'bigdecimal'
8
+ gem 'rails', '8.0.2.1'
11
9
  end
12
10
 
13
- appraise 'rails-7-2' do
14
- gem 'rails', '7.2.2.1'
11
+ appraise 'rails-8-1' do
12
+ gem 'rails', '8.1.1'
15
13
  end
data/CHANGELOG.md CHANGED
@@ -4,7 +4,21 @@ This project adheres to [Semantic Versioning](http://semver.org/).
4
4
 
5
5
  Please follow the format in [Keep a Changelog](http://keepachangelog.com/)
6
6
 
7
- ## [Unreleased]
7
+ ## [NEXT]
8
+
9
+ ## [8.0.0] - 2025-11-24
10
+
11
+ - Bump [appraisal to 2.5.0](https://github.com/departurerb/departure/pull/129)
12
+ - Add support for [Rails 8.1](https://github.com/departurerb/departure/pull/128)
13
+ - Skinnify Departure [to remove most non pt-online-schema-change](https://github.com/departurerb/departure/pull/131) responsibility from departure
14
+ - Inherit from [Mysql2 Adapter instead of AbstractMysqlAdapter](https://github.com/departurerb/departure/pull/130)
15
+ - Remove Support for [Rails 7.0 and Rails 7.1](https://github.com/departurerb/departure/pull/135)
16
+
17
+ ## [7.0.0] - 2025-08-21
18
+
19
+ - Drop Ruby 3.1 support. Add >= 3.2 ruby support in gemspec. EOL for 3.1.0 was 2025-03-31
20
+ - Drop Rails 6.1 support. Add >= 6.2 rails support in gemspec. EOL for 6.1.0 was 2024-10-01
21
+ - Add Rails 8.0 support
8
22
 
9
23
  ## [6.8.0] - 2025-03-31
10
24
 
data/Dockerfile CHANGED
@@ -1,4 +1,4 @@
1
- FROM ruby:3.0
1
+ FROM ruby:3.4
2
2
  MAINTAINER muffinista@gmail.com
3
3
 
4
4
  # Install apt based dependencies required to run Rails as
@@ -14,17 +14,10 @@ RUN apt-get update && apt-get install -y \
14
14
  RUN mkdir -p /app /app/lib/departure
15
15
  WORKDIR /app
16
16
 
17
- # Copy the Gemfile as well as the Gemfile.lock and install
18
- # the RubyGems. This is a separate step so the dependencies
19
- # will be cached unless changes to one of those two files
20
- # are made.
21
- COPY departure.gemspec Gemfile ./
22
- COPY lib/departure/version.rb ./lib/departure/
17
+ # Install bundler - dependencies will be installed via volume mount
18
+ RUN gem install bundler
23
19
 
24
- RUN gem install bundler && bundle install --jobs 20 --retry 5
25
-
26
- # Copy the main application.
27
- COPY . ./
20
+ # Project root will be mounted as volume for live development
28
21
 
29
22
  # The main command to run when the container starts. Also
30
23
  # tell the Rails dev server to bind to all interfaces by
data/Gemfile CHANGED
@@ -9,3 +9,4 @@ gem 'logger'
9
9
  gem 'mutex_m', require: false
10
10
  gem 'rubocop', '~> 1.74.0', require: false
11
11
  gem 'rubocop-performance', '~> 1.20.2', require: false
12
+ gem 'zeitwerk', '< 2.7.0'
data/Gemfile.lock CHANGED
@@ -1,149 +1,161 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- departure (6.8.0)
5
- activerecord (>= 6.0.0, < 7.3.0, != 7.0.0)
4
+ departure (8.0.0)
5
+ activerecord (>= 7.2.0)
6
6
  mysql2 (>= 0.4.0, < 0.6.0)
7
- railties (>= 6.0.0, < 7.3.0, != 7.0.0)
7
+ railties (>= 7.2.0)
8
8
 
9
9
  GEM
10
10
  remote: https://rubygems.org/
11
11
  specs:
12
- actionpack (7.1.3)
13
- actionview (= 7.1.3)
14
- activesupport (= 7.1.3)
12
+ actionpack (8.0.2.1)
13
+ actionview (= 8.0.2.1)
14
+ activesupport (= 8.0.2.1)
15
15
  nokogiri (>= 1.8.5)
16
- racc
17
16
  rack (>= 2.2.4)
18
17
  rack-session (>= 1.0.1)
19
18
  rack-test (>= 0.6.3)
20
19
  rails-dom-testing (~> 2.2)
21
20
  rails-html-sanitizer (~> 1.6)
22
- actionview (7.1.3)
23
- activesupport (= 7.1.3)
21
+ useragent (~> 0.16)
22
+ actionview (8.0.2.1)
23
+ activesupport (= 8.0.2.1)
24
24
  builder (~> 3.1)
25
25
  erubi (~> 1.11)
26
26
  rails-dom-testing (~> 2.2)
27
27
  rails-html-sanitizer (~> 1.6)
28
- activemodel (7.1.3)
29
- activesupport (= 7.1.3)
30
- activerecord (7.1.3)
31
- activemodel (= 7.1.3)
32
- activesupport (= 7.1.3)
28
+ activemodel (8.0.2.1)
29
+ activesupport (= 8.0.2.1)
30
+ activerecord (8.0.2.1)
31
+ activemodel (= 8.0.2.1)
32
+ activesupport (= 8.0.2.1)
33
33
  timeout (>= 0.4.0)
34
- activesupport (7.1.3)
34
+ activesupport (8.0.2.1)
35
35
  base64
36
+ benchmark (>= 0.3)
36
37
  bigdecimal
37
- concurrent-ruby (~> 1.0, >= 1.0.2)
38
+ concurrent-ruby (~> 1.0, >= 1.3.1)
38
39
  connection_pool (>= 2.2.5)
39
40
  drb
40
41
  i18n (>= 1.6, < 2)
42
+ logger (>= 1.4.2)
41
43
  minitest (>= 5.1)
42
- mutex_m
43
- tzinfo (~> 2.0)
44
- appraisal (2.4.1)
44
+ securerandom (>= 0.3)
45
+ tzinfo (~> 2.0, >= 2.0.5)
46
+ uri (>= 0.13.1)
47
+ appraisal (2.5.0)
45
48
  bundler
46
49
  rake
47
50
  thor (>= 0.14.0)
48
- ast (2.4.2)
51
+ ast (2.4.3)
49
52
  base64 (0.2.0)
50
- bigdecimal (3.1.6)
51
- builder (3.2.4)
52
- byebug (11.1.3)
53
+ benchmark (0.4.0)
54
+ bigdecimal (3.1.9)
55
+ builder (3.3.0)
56
+ byebug (12.0.0)
53
57
  climate_control (0.0.4)
54
58
  activesupport (>= 3.0)
55
59
  codeclimate-test-reporter (1.0.9)
56
60
  simplecov (<= 0.13)
57
61
  coderay (1.1.3)
58
- concurrent-ruby (1.2.3)
59
- connection_pool (2.4.1)
62
+ concurrent-ruby (1.3.5)
63
+ connection_pool (2.5.0)
60
64
  crass (1.0.6)
61
- diff-lcs (1.5.1)
65
+ date (3.4.1)
66
+ diff-lcs (1.6.1)
62
67
  docile (1.1.5)
63
- drb (2.2.0)
64
- ruby2_keywords
65
- erubi (1.12.0)
66
- i18n (1.14.1)
68
+ drb (2.2.1)
69
+ erubi (1.13.1)
70
+ i18n (1.14.7)
67
71
  concurrent-ruby (~> 1.0)
68
- io-console (0.7.2)
69
- irb (1.11.2)
70
- rdoc
72
+ io-console (0.8.0)
73
+ irb (1.15.1)
74
+ pp (>= 0.6.0)
75
+ rdoc (>= 4.0.0)
71
76
  reline (>= 0.4.2)
72
77
  json (2.10.2)
73
78
  language_server-protocol (3.17.0.4)
74
79
  lhm (2.2.0)
75
80
  lint_roller (1.1.0)
76
- logger (1.6.6)
77
- loofah (2.22.0)
81
+ logger (1.7.0)
82
+ loofah (2.24.0)
78
83
  crass (~> 1.0.2)
79
84
  nokogiri (>= 1.12.0)
80
- method_source (1.0.0)
81
- minitest (5.22.2)
82
- mutex_m (0.2.0)
85
+ method_source (1.1.0)
86
+ minitest (5.25.5)
87
+ mutex_m (0.3.0)
83
88
  mysql2 (0.5.6)
84
- nokogiri (1.18.3-arm64-darwin)
89
+ nokogiri (1.18.7-aarch64-linux-gnu)
90
+ racc (~> 1.4)
91
+ nokogiri (1.18.7-arm64-darwin)
85
92
  racc (~> 1.4)
86
- nokogiri (1.18.3-x86_64-linux-gnu)
93
+ nokogiri (1.18.7-x86_64-linux-gnu)
87
94
  racc (~> 1.4)
88
95
  parallel (1.26.3)
89
- parser (3.3.7.1)
96
+ parser (3.3.7.4)
90
97
  ast (~> 2.4.1)
91
98
  racc
92
- pry (0.14.2)
99
+ pp (0.6.2)
100
+ prettyprint
101
+ prettyprint (0.2.0)
102
+ prism (1.4.0)
103
+ pry (0.15.2)
93
104
  coderay (~> 1.1)
94
105
  method_source (~> 1.0)
95
- pry-byebug (3.10.1)
96
- byebug (~> 11.0)
97
- pry (>= 0.13, < 0.15)
98
- psych (5.1.2)
106
+ pry-byebug (3.11.0)
107
+ byebug (~> 12.0)
108
+ pry (>= 0.13, < 0.16)
109
+ psych (5.2.3)
110
+ date
99
111
  stringio
100
112
  racc (1.8.1)
101
- rack (3.0.9)
102
- rack-session (2.0.0)
113
+ rack (3.1.12)
114
+ rack-session (2.1.0)
115
+ base64 (>= 0.1.0)
103
116
  rack (>= 3.0.0)
104
- rack-test (2.1.0)
117
+ rack-test (2.2.0)
105
118
  rack (>= 1.3)
106
- rackup (2.1.0)
119
+ rackup (2.2.1)
107
120
  rack (>= 3)
108
- webrick (~> 1.8)
109
121
  rails-dom-testing (2.2.0)
110
122
  activesupport (>= 5.0.0)
111
123
  minitest
112
124
  nokogiri (>= 1.6)
113
- rails-html-sanitizer (1.6.0)
125
+ rails-html-sanitizer (1.6.2)
114
126
  loofah (~> 2.21)
115
- nokogiri (~> 1.14)
116
- railties (7.1.3)
117
- actionpack (= 7.1.3)
118
- activesupport (= 7.1.3)
119
- irb
127
+ nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0)
128
+ railties (8.0.2.1)
129
+ actionpack (= 8.0.2.1)
130
+ activesupport (= 8.0.2.1)
131
+ irb (~> 1.13)
120
132
  rackup (>= 1.0.0)
121
133
  rake (>= 12.2)
122
134
  thor (~> 1.0, >= 1.2.2)
123
135
  zeitwerk (~> 2.6)
124
136
  rainbow (3.1.1)
125
- rake (13.1.0)
126
- rdoc (6.6.2)
137
+ rake (13.2.1)
138
+ rdoc (6.13.1)
127
139
  psych (>= 4.0.0)
128
140
  regexp_parser (2.10.0)
129
- reline (0.4.2)
141
+ reline (0.6.0)
130
142
  io-console (~> 0.5)
131
143
  rspec (3.13.0)
132
144
  rspec-core (~> 3.13.0)
133
145
  rspec-expectations (~> 3.13.0)
134
146
  rspec-mocks (~> 3.13.0)
135
- rspec-core (3.13.0)
147
+ rspec-core (3.13.3)
136
148
  rspec-support (~> 3.13.0)
137
- rspec-expectations (3.13.0)
149
+ rspec-expectations (3.13.3)
138
150
  diff-lcs (>= 1.2.0, < 2.0)
139
151
  rspec-support (~> 3.13.0)
140
- rspec-its (1.3.0)
152
+ rspec-its (1.3.1)
141
153
  rspec-core (>= 3.0.0)
142
154
  rspec-expectations (>= 3.0.0)
143
- rspec-mocks (3.13.0)
155
+ rspec-mocks (3.13.2)
144
156
  diff-lcs (>= 1.2.0, < 2.0)
145
157
  rspec-support (~> 3.13.0)
146
- rspec-support (3.13.0)
158
+ rspec-support (3.13.2)
147
159
  rubocop (1.74.0)
148
160
  json (~> 2.3)
149
161
  language_server-protocol (~> 3.17.0.2)
@@ -155,30 +167,33 @@ GEM
155
167
  rubocop-ast (>= 1.38.0, < 2.0)
156
168
  ruby-progressbar (~> 1.7)
157
169
  unicode-display_width (>= 2.4.0, < 4.0)
158
- rubocop-ast (1.39.0)
159
- parser (>= 3.3.1.0)
170
+ rubocop-ast (1.43.0)
171
+ parser (>= 3.3.7.2)
172
+ prism (~> 1.4)
160
173
  rubocop-performance (1.20.2)
161
174
  rubocop (>= 1.48.1, < 2.0)
162
175
  rubocop-ast (>= 1.30.0, < 2.0)
163
176
  ruby-progressbar (1.13.0)
164
- ruby2_keywords (0.0.5)
177
+ securerandom (0.4.1)
165
178
  simplecov (0.13.0)
166
179
  docile (~> 1.1.0)
167
180
  json (>= 1.8, < 3)
168
181
  simplecov-html (~> 0.10.0)
169
182
  simplecov-html (0.10.2)
170
- stringio (3.1.0)
171
- thor (1.3.0)
172
- timeout (0.4.1)
183
+ stringio (3.1.6)
184
+ thor (1.3.2)
185
+ timeout (0.4.3)
173
186
  tzinfo (2.0.6)
174
187
  concurrent-ruby (~> 1.0)
175
188
  unicode-display_width (3.1.4)
176
189
  unicode-emoji (~> 4.0, >= 4.0.4)
177
190
  unicode-emoji (4.0.4)
178
- webrick (1.8.1)
179
- zeitwerk (2.6.13)
191
+ uri (1.0.3)
192
+ useragent (0.16.11)
193
+ zeitwerk (2.6.18)
180
194
 
181
195
  PLATFORMS
196
+ aarch64-linux
182
197
  arm64-darwin-21
183
198
  arm64-darwin-22
184
199
  arm64-darwin-23
@@ -186,7 +201,7 @@ PLATFORMS
186
201
  x86_64-linux
187
202
 
188
203
  DEPENDENCIES
189
- appraisal (~> 2.4.1)
204
+ appraisal (~> 2.5.0)
190
205
  base64
191
206
  climate_control (~> 0.0.3)
192
207
  codeclimate-test-reporter (~> 1.0.3)
@@ -200,6 +215,7 @@ DEPENDENCIES
200
215
  rspec-its (~> 1.2)
201
216
  rubocop (~> 1.74.0)
202
217
  rubocop-performance (~> 1.20.2)
218
+ zeitwerk (< 2.7.0)
203
219
 
204
220
  BUNDLED WITH
205
- 2.4.22
221
+ 2.6.6
data/README.md CHANGED
@@ -213,6 +213,70 @@ When any errors occur, an `ActiveRecord::StatementInvalid` exception is
213
213
  raised and the migration is aborted, as all other ActiveRecord connection
214
214
  adapters.
215
215
 
216
+ ### Diagram
217
+
218
+ ```mermaid
219
+ flowchart TB
220
+ %% User Level
221
+ subgraph "Rails Application"
222
+ Migration["Rails Migration<br/>(ActiveRecord::Migration)"]
223
+ DSL["Migration DSL<br/>(add_column, create_table, etc.)"]
224
+ end
225
+
226
+ %% Core Departure Components
227
+ subgraph "Departure System"
228
+ RailsAdapter["RailsAdapter<br/>(Version Detection)"]
229
+ DepartureAdapter["Rails81DepartureAdapter<br/>(Connection Adapter)"]
230
+ Runner["Runner<br/>(Query Interceptor)"]
231
+ Command["Command<br/>(Process Executor)"]
232
+ CliGenerator["CliGenerator<br/>(Command Builder)"]
233
+ end
234
+
235
+ %% External Components
236
+ subgraph "External Tools"
237
+ PTOSC["pt-online-schema-change<br/>(Percona Toolkit)"]
238
+ MySQL["MySQL Database"]
239
+ end
240
+
241
+ %% LHM Integration
242
+ subgraph "LHM Integration"
243
+ LhmAdapter["Lhm::Adapter<br/>(DSL Translator)"]
244
+ LhmMigration["LHM Migration"]
245
+ end
246
+
247
+ %% Flow connections
248
+ Migration --> DSL
249
+ DSL --> DepartureAdapter
250
+ DepartureAdapter --> Runner
251
+ Runner --> |"Non-ALTER statements"| MySQL
252
+ CliGenerator --> Command
253
+ Command --> PTOSC
254
+ PTOSC --> MySQL
255
+
256
+ %% LHM Flow
257
+ LhmMigration --> LhmAdapter
258
+ LhmAdapter --> DSL
259
+
260
+ %% Configuration Flow
261
+ RailsAdapter --> |"Registers"| DepartureAdapter
262
+
263
+ %% Decision Points
264
+ Runner --> |"Check: ALTER TABLE?"| DecisionNode{{"ALTER TABLE<br/>Statement?"}}
265
+ DecisionNode --> |"Yes"| CliGenerator
266
+ DecisionNode --> |"No"| MySQL
267
+
268
+ %% Styling
269
+ classDef departure fill:#e1f5fe
270
+ classDef external fill:#fff3e0
271
+ classDef rails fill:#e8f5e8
272
+ classDef lhm fill:#fce4ec
273
+
274
+ class RailsAdapter,DepartureAdapter,Runner,Command,CliGenerator departure
275
+ class PTOSC,MySQL external
276
+ class Migration,DSL rails
277
+ class LhmAdapter,LhmMigration lhm
278
+ ```
279
+
216
280
  ## Trouleshooting
217
281
 
218
282
  ### Error creating new table: DBD::mysql::db do failed: Can't write; duplicate key in table (TABLE_NAME)
@@ -221,6 +285,24 @@ that prevents schema changes when a table has constraints. You should upgrade to
221
285
 
222
286
  ## Development
223
287
 
288
+ ### Setup
289
+
290
+ #### Docker Compose
291
+
292
+ You can bring up the docker-compose setup and bash into rails in order to not install dependencies on your system
293
+
294
+ Gems are available on your local file system from tmp/local_gems directory. We need this due to changes in
295
+ internals of ActiveRecord and needing to run things like pry to debug how they work.
296
+
297
+ ```
298
+ docker compose up
299
+ docker compose exec rails bash
300
+ bundle install
301
+ # off to the races
302
+ ```
303
+
304
+ #### Manual
305
+
224
306
  After checking out the repo, run `bin/setup` to install dependencies. Then, run
225
307
  `rake spec` to run the tests. You can also run `bin/console` for an interactive
226
308
  prompt that will allow you to experiment.
@@ -231,6 +313,26 @@ release a new version, update the version number in `version.rb`, and then run
231
313
  git commits and tags, and push the `.gem` file to
232
314
  [rubygems.org](https://rubygems.org).
233
315
 
316
+ ### Appraisal
317
+
318
+ All versions of supported rails are defined in the [Appraisals file](./Appraisals) in project root
319
+
320
+ #### Usage
321
+
322
+ Say you want to run a specific test under a version of rails defined in Appraisal `rails-8-0`
323
+
324
+ ```
325
+ bundle exec appraisal rails-8-0 bundle install
326
+ bundle exec appraisal rails-8-0 bundle exec rspec spec/lhm/column_with_sql_spec.rb:50
327
+ ```
328
+
329
+ #### Adding Versions
330
+
331
+ - Add the version to [Appraisals file](./Appraisals)
332
+ - Run `bundle exec appraisal generate`
333
+ - Run `bundle exec appraisal install`
334
+ - updates ci [test.yml](./.github/workflows/test.yml) in the `gemfile:` section
335
+
234
336
  ## Contributing
235
337
 
236
338
  Bug reports and pull requests are welcome on GitHub at
data/Rakefile CHANGED
@@ -1,6 +1,7 @@
1
1
  require 'bundler/gem_tasks'
2
2
  require 'rspec/core/rake_task'
3
3
 
4
+ require 'logger'
4
5
  require './configuration'
5
6
  require './test_database'
6
7
 
data/config.yml.erb CHANGED
@@ -1,5 +1,9 @@
1
1
  username: <%= ENV['PERCONA_DB_USER'] || 'root' %>
2
- password: <%= ENV['PERCONA_DB_PASSWORD'] || '' %>
3
- database: <%= ENV['PERCONA_DB_NAME'] || 'departure_test' %>
4
- hostname: <%= ENV['PERCONA_DB_HOST'] || 'localhost' %>
5
- socket: <%= ENV['PERCONA_DB_SOCKET'] || '' %>
2
+ password: <%= ENV['PERCONA_DB_PASSWORD'] || '' %>
3
+ database: <%= ENV['PERCONA_DB_NAME'] || 'departure_test' %>
4
+ <% if ENV['PERCONA_DB_SOCKET'] && !ENV['PERCONA_DB_SOCKET'].empty? %>
5
+ socket: <%= ENV['PERCONA_DB_SOCKET'] %>
6
+ <% else %>
7
+ host: <%= ENV['PERCONA_DB_HOST'] || 'localhost' %>
8
+ port: <%= ENV['PERCONA_DB_PORT'] || 3306 %>
9
+ <% end %>
data/departure.gemspec CHANGED
@@ -19,13 +19,13 @@ Gem::Specification.new do |spec|
19
19
  spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
20
20
  spec.require_paths = ['lib']
21
21
 
22
- spec.required_ruby_version = '>= 2.7.0'
22
+ spec.required_ruby_version = '>= 3.2.0'
23
23
 
24
- spec.add_runtime_dependency 'railties', '>= 6.0.0', '!= 7.0.0', '< 7.3.0'
25
- spec.add_runtime_dependency 'activerecord', '>= 6.0.0', '!= 7.0.0', '< 7.3.0'
24
+ spec.add_runtime_dependency 'railties', '>= 7.2.0'
25
+ spec.add_runtime_dependency 'activerecord', '>= 7.2.0'
26
26
  spec.add_runtime_dependency 'mysql2', '>= 0.4.0', '< 0.6.0'
27
27
 
28
- spec.add_development_dependency 'appraisal', '~> 2.4.1'
28
+ spec.add_development_dependency 'appraisal', '~> 2.5.0'
29
29
  spec.add_development_dependency 'rake', '>= 10.0'
30
30
  spec.add_development_dependency 'rspec', '~> 3.4', '>= 3.4.0'
31
31
  spec.add_development_dependency 'rspec-its', '~> 1.2'
data/docker-compose.yml CHANGED
@@ -16,7 +16,11 @@ services:
16
16
  - db
17
17
  tty: true
18
18
  stdin_open: true
19
+ volumes:
20
+ - .:/app
21
+ - ./tmp/local_gems:/app/vendor/bundle
19
22
  environment:
23
+ BUNDLE_PATH: /app/vendor/bundle
20
24
  PERCONA_DB_USER: root
21
25
  PERCONA_DB_HOST: db
22
26
  PERCONA_DB_PASSWORD:
@@ -1,10 +1,16 @@
1
1
  # This file was generated by Appraisal
2
2
 
3
- source 'https://rubygems.org'
3
+ source "https://rubygems.org"
4
4
 
5
- gem 'codeclimate-test-reporter', '~> 1.0.3', group: :test, require: nil
6
- gem 'rails', '7.2.2.1'
7
- gem 'rubocop', '~> 1.74.0', require: false
8
- gem 'rubocop-performance', '~> 1.20.2', require: false
5
+ gem "base64"
6
+ gem "codeclimate-test-reporter", "~> 1.0.3", group: :test, require: nil
7
+ gem "lhm"
8
+ gem "logger"
9
+ gem "mutex_m", require: false
10
+ gem "rubocop", "~> 1.74.0", require: false
11
+ gem "rubocop-performance", "~> 1.20.2", require: false
12
+ gem "zeitwerk", "< 2.7.0"
13
+ gem "bigdecimal"
14
+ gem "rails", "7.2.2.1"
9
15
 
10
- gemspec path: '../'
16
+ gemspec path: "../"