data_migrate 9.3.0 → 10.0.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (50) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/build.yml +3 -3
  3. data/.github/workflows/gempush.yml +8 -6
  4. data/.gitignore +2 -3
  5. data/.ruby-version +1 -0
  6. data/.travis.yml +14 -0
  7. data/Appraisals +5 -5
  8. data/Changelog.md +2 -36
  9. data/Gemfile +1 -0
  10. data/Gemfile.rails6.1 +11 -0
  11. data/README.md +5 -7
  12. data/data_migrate.gemspec +2 -2
  13. data/gemfiles/{rails_7.1.gemfile → rails_6.0.gemfile} +2 -1
  14. data/gemfiles/rails_6.1.gemfile +1 -0
  15. data/gemfiles/rails_7.0.gemfile +2 -1
  16. data/lib/data_migrate/data_migrator.rb +23 -11
  17. data/lib/data_migrate/data_schema.rb +2 -2
  18. data/lib/data_migrate/data_schema_migration.rb +7 -24
  19. data/lib/data_migrate/database_tasks.rb +48 -126
  20. data/lib/data_migrate/legacy_migrator.rb +22 -0
  21. data/lib/data_migrate/migration_context.rb +8 -11
  22. data/lib/data_migrate/schema_dumper.rb +1 -1
  23. data/lib/data_migrate/schema_migration.rb +4 -5
  24. data/lib/data_migrate/status_service.rb +4 -4
  25. data/lib/data_migrate/tasks/data_migrate_tasks.rb +15 -14
  26. data/lib/data_migrate/version.rb +1 -1
  27. data/lib/data_migrate.rb +1 -2
  28. data/spec/data_migrate/data_migrator_spec.rb +14 -17
  29. data/spec/data_migrate/data_schema_migration_spec.rb +8 -25
  30. data/spec/data_migrate/data_spec.rb +1 -1
  31. data/spec/data_migrate/database_tasks_spec.rb +19 -34
  32. data/spec/data_migrate/legacy_migrator_spec.rb +38 -0
  33. data/spec/data_migrate/migration_context_spec.rb +8 -15
  34. data/spec/data_migrate/schema_dumper_spec.rb +3 -6
  35. data/spec/data_migrate/schema_migration_spec.rb +6 -13
  36. data/spec/data_migrate/status_service_spec.rb +4 -7
  37. data/spec/data_migrate/tasks/data_migrate_tasks_spec.rb +14 -13
  38. data/spec/db/data/20091231235959_some_name.rb +1 -1
  39. data/spec/db/data/20171231235959_super_update.rb +1 -1
  40. data/spec/db/migrate/20131111111111_late_migration.rb +1 -1
  41. data/spec/db/migrate/20202020202011_db_migration.rb +1 -1
  42. data/tasks/databases.rake +76 -38
  43. metadata +19 -21
  44. data/Gemfile.lock +0 -184
  45. data/gemfiles/rails_6.1.gemfile.lock +0 -229
  46. data/gemfiles/rails_7.0.gemfile.lock +0 -230
  47. data/gemfiles/rails_7.1.gemfile.lock +0 -263
  48. data/lib/data_migrate/database_configurations_wrapper.rb +0 -11
  49. data/lib/data_migrate/rails_helper.rb +0 -79
  50. data/lib/data_migrate/test.rb +0 -14
@@ -3,17 +3,17 @@
3
3
  require "spec_helper"
4
4
 
5
5
  describe DataMigrate::Tasks::DataMigrateTasks do
6
- let(:db_config) do
7
- {
8
- adapter: "sqlite3",
9
- database: "spec/db/test.db"
10
- }
6
+ let(:connection_db_config) do
7
+ if Gem::Dependency.new("rails", ">= 6.1").match?("rails", Gem.loaded_specs["rails"].version)
8
+ ActiveRecord::Base.connection_db_config
9
+ else
10
+ ActiveRecord::Base.configurations.configs_for.first
11
+ end
11
12
  end
12
13
 
13
14
  before do
14
- ActiveRecord::Base.establish_connection(db_config)
15
- DataMigrate::RailsHelper.schema_migration.create_table
16
- DataMigrate::RailsHelper.data_schema_migration.create_table
15
+ ActiveRecord::SchemaMigration.create_table
16
+ DataMigrate::DataSchemaMigration.create_table
17
17
  end
18
18
 
19
19
  after do
@@ -28,11 +28,11 @@ describe DataMigrate::Tasks::DataMigrateTasks do
28
28
  end
29
29
 
30
30
  context 'when not given a separate db config' do
31
- it 'does not override the default connection' do
31
+ it 'does not override the default connection' do
32
32
  expect(ActiveRecord::Base).not_to receive(:establish_connection)
33
33
  expect(DataMigrate::SchemaDumper).to receive(:dump)
34
34
 
35
- DataMigrate::Tasks::DataMigrateTasks.dump
35
+ DataMigrate::Tasks::DataMigrateTasks.dump(connection_db_config)
36
36
  end
37
37
  end
38
38
 
@@ -56,7 +56,8 @@ describe DataMigrate::Tasks::DataMigrateTasks do
56
56
 
57
57
  it 'overrides the default connection' do
58
58
  expect(ActiveRecord::Base).to receive(:establish_connection).with(override_config)
59
- DataMigrate::Tasks::DataMigrateTasks.dump
59
+
60
+ DataMigrate::Tasks::DataMigrateTasks.dump(connection_db_config)
60
61
  end
61
62
  end
62
63
  end
@@ -115,13 +116,13 @@ describe DataMigrate::Tasks::DataMigrateTasks do
115
116
 
116
117
  it "should display data migration status" do
117
118
  expect {
118
- DataMigrate::Tasks::DataMigrateTasks.status
119
+ DataMigrate::Tasks::DataMigrateTasks.status(connection_db_config)
119
120
  }.to output(/up 20091231235959 Some name/).to_stdout
120
121
  end
121
122
 
122
123
  it "should display schema and data migration status" do
123
124
  expect {
124
- DataMigrate::Tasks::DataMigrateTasks.status_with_schema
125
+ DataMigrate::Tasks::DataMigrateTasks.status_with_schema(connection_db_config)
125
126
  }.to output(match(/up data 20091231235959 Some name/)
126
127
  .and match(/down schema 20131111111111 Late migration/)).to_stdout
127
128
  end
@@ -1,4 +1,4 @@
1
- class SomeName < ActiveRecord::Migration[6.1]
1
+ class SomeName < ActiveRecord::Migration[6.0]
2
2
  def up
3
3
  puts "Doing data migration"
4
4
  end
@@ -1,4 +1,4 @@
1
- class SuperUpdate < ActiveRecord::Migration[6.1]
1
+ class SuperUpdate < ActiveRecord::Migration[6.0]
2
2
  def up
3
3
  puts "Doing SuperUpdate"
4
4
  end
@@ -1,4 +1,4 @@
1
- class LateMigration < ActiveRecord::Migration[6.1]
1
+ class LateMigration < ActiveRecord::Migration[6.0]
2
2
  def up
3
3
  puts "Doing schema LateMigration"
4
4
  end
@@ -1,4 +1,4 @@
1
- class DbMigration < ActiveRecord::Migration[6.1]
1
+ class DbMigration < ActiveRecord::Migration[6.0]
2
2
  def up
3
3
  puts "Doing schema migration"
4
4
  end
data/tasks/databases.rake CHANGED
@@ -6,42 +6,65 @@ namespace :db do
6
6
  namespace :migrate do
7
7
  desc "Migrate the database data and schema (options: VERSION=x, VERBOSE=false)."
8
8
  task :with_data => :environment do
9
- DataMigrate::DataMigrator.create_data_schema_table
10
- ActiveRecord::Migration.verbose = ENV["VERBOSE"] ? ENV["VERBOSE"] == "true" : true
11
-
12
- db_configs = ActiveRecord::Base.configurations.configs_for(env_name: ActiveRecord::Tasks::DatabaseTasks.env)
9
+ original_db_config = ActiveRecord::Base.connection_db_config
10
+ ActiveRecord::Base.configurations.configs_for(env_name: ActiveRecord::Tasks::DatabaseTasks.env).each do |db_config|
11
+ ActiveRecord::Base.establish_connection(db_config)
12
+ DataMigrate::DataMigrator.assure_data_schema_table
13
13
 
14
- schema_mapped_versions = ActiveRecord::Tasks::DatabaseTasks.db_configs_with_versions(db_configs)
15
- data_mapped_versions = DataMigrate::DatabaseTasks.db_configs_with_versions
14
+ ActiveRecord::Migration.verbose = ENV["VERBOSE"] ? ENV["VERBOSE"] == "true" : true
15
+ target_version = ENV["VERSION"] ? ENV["VERSION"].to_i : nil
16
+ migrations = []
16
17
 
17
- mapped_versions = schema_mapped_versions.merge(data_mapped_versions) do |_key, schema_db_configs, data_db_configs|
18
- schema_db_configs + data_db_configs
18
+ if target_version.nil?
19
+ migrations = DataMigrate::DatabaseTasks.pending_migrations.map{ |m| m.merge(:direction =>:up) }
20
+ else
21
+ current_schema_version = ActiveRecord::Migrator.current_version
22
+ schema_migrations = if target_version > current_schema_version
23
+ DataMigrate::DatabaseTasks.pending_schema_migrations.keep_if{ |m| m[:version] <= target_version }.map{ |m| m.merge(:direction =>:up) }
24
+ elsif target_version < current_schema_version
25
+ DataMigrate::DatabaseTasks.past_migrations.keep_if{ |m| m[:version] > target_version }.map{ |m| m.merge(:direction =>:down) }
26
+ else # ==
27
+ []
28
+ end
29
+
30
+ current_data_version = DataMigrate::DataMigrator.current_version
31
+ data_migrations = if target_version > current_data_version
32
+ DataMigrate::DatabaseTasks.pending_data_migrations.keep_if{ |m| m[:version] <= target_version }.map{ |m| m.merge(:direction =>:up) }
33
+ elsif target_version < current_data_version
34
+ DataMigrate::DatabaseTasks.past_migrations.keep_if{ |m| m[:version] > target_version }.map{ |m| m.merge(:direction =>:down) }
35
+ else # ==
36
+ []
37
+ end
38
+ migrations = if schema_migrations.empty?
39
+ data_migrations
40
+ elsif data_migrations.empty?
41
+ schema_migrations
42
+ elsif target_version > current_data_version && target_version > current_schema_version
43
+ DataMigrate::DatabaseTasks.sort_migrations data_migrations, schema_migrations
44
+ elsif target_version < current_data_version && target_version < current_schema_version
45
+ DataMigrate::DatabaseTasks.sort_migrations(data_migrations, schema_migrations).reverse
46
+ elsif target_version > current_data_version && target_version < current_schema_version
47
+ schema_migrations + data_migrations
48
+ elsif target_version < current_data_version && target_version > current_schema_version
49
+ schema_migrations + data_migrations
50
+ end
19
51
  end
20
52
 
21
- mapped_versions.sort.each do |version, db_configs|
22
- db_configs.each do |db_config|
23
- if is_data_migration = db_config.is_a?(DataMigrate::DatabaseConfigurationWrapper)
24
- db_config = db_config.db_config
25
- end
26
-
27
- DataMigrate::DatabaseTasks.with_temporary_connection(db_config) do
28
- if is_data_migration
29
- DataMigrate::DataMigrator.run(:up, DataMigrate::DatabaseTasks.data_migrations_path, version)
30
- else
31
- ActiveRecord::Tasks::DatabaseTasks.migrate(version)
32
- end
33
- end
34
- end
53
+ migrations.each do |migration|
54
+ DataMigrate::DatabaseTasks.run_migration(migration, migration[:direction])
55
+ end
35
56
  end
36
57
 
37
58
  Rake::Task["db:_dump"].invoke
38
59
  Rake::Task["data:dump"].invoke
60
+ ensure
61
+ ActiveRecord::Base.establish_connection(original_db_config)
39
62
  end
40
63
 
41
64
  namespace :redo do
42
65
  desc 'Rollbacks the database one migration and re migrate up (options: STEP=x, VERSION=x).'
43
66
  task :with_data => :environment do
44
- DataMigrate::DataMigrator.create_data_schema_table
67
+ DataMigrate::DataMigrator.assure_data_schema_table
45
68
  if ENV["VERSION"]
46
69
  Rake::Task["db:migrate:down:with_data"].invoke
47
70
  Rake::Task["db:migrate:up:with_data"].invoke
@@ -57,7 +80,7 @@ namespace :db do
57
80
  task :with_data => :environment do
58
81
  version = ENV["VERSION"] ? ENV["VERSION"].to_i : nil
59
82
  raise "VERSION is required" unless version
60
- DataMigrate::DataMigrator.create_data_schema_table
83
+ DataMigrate::DataMigrator.assure_data_schema_table
61
84
  run_both = ENV["BOTH"] == "true"
62
85
  migrations = DataMigrate::DatabaseTasks.pending_migrations.keep_if{|m| m[:version] == version}
63
86
 
@@ -79,7 +102,7 @@ namespace :db do
79
102
  task :with_data => :environment do
80
103
  version = ENV["VERSION"] ? ENV["VERSION"].to_i : nil
81
104
  raise "VERSION is required" unless version
82
- DataMigrate::DataMigrator.create_data_schema_table
105
+ DataMigrate::DataMigrator.assure_data_schema_table
83
106
  run_both = ENV["BOTH"] == "true"
84
107
  migrations = DataMigrate::DatabaseTasks.past_migrations.keep_if{|m| m[:version] == version}
85
108
 
@@ -99,7 +122,10 @@ namespace :db do
99
122
  namespace :status do
100
123
  desc "Display status of data and schema migrations"
101
124
  task :with_data => :environment do
102
- DataMigrate::Tasks::DataMigrateTasks.status_with_schema
125
+ ActiveRecord::Base.configurations.configs_for(env_name: ActiveRecord::Tasks::DatabaseTasks.env).each do |db_config|
126
+ ActiveRecord::Base.establish_connection(db_config)
127
+ DataMigrate::Tasks::DataMigrateTasks.status_with_schema(db_config)
128
+ end
103
129
  end
104
130
  end
105
131
  end # END OF MIGRATE NAME SPACE
@@ -108,7 +134,7 @@ namespace :db do
108
134
  desc 'Rolls the schema back to the previous version (specify steps w/ STEP=n).'
109
135
  task :with_data => :environment do
110
136
  step = ENV['STEP'] ? ENV['STEP'].to_i : 1
111
- DataMigrate::DataMigrator.create_data_schema_table
137
+ DataMigrate::DataMigrator.assure_data_schema_table
112
138
  DataMigrate::DatabaseTasks.past_migrations[0..(step - 1)].each do | past_migration |
113
139
  DataMigrate::DatabaseTasks.run_migration(past_migration, :down)
114
140
  end
@@ -121,7 +147,7 @@ namespace :db do
121
147
  namespace :forward do
122
148
  desc 'Pushes the schema to the next version (specify steps w/ STEP=n).'
123
149
  task :with_data => :environment do
124
- DataMigrate::DataMigrator.create_data_schema_table
150
+ DataMigrate::DataMigrator.assure_data_schema_table
125
151
  step = ENV['STEP'] ? ENV['STEP'].to_i : 1
126
152
  DataMigrate::DatabaseTasks.forward(step)
127
153
  Rake::Task["db:_dump"].invoke
@@ -132,7 +158,7 @@ namespace :db do
132
158
  namespace :version do
133
159
  desc "Retrieves the current schema version numbers for data and schema migrations"
134
160
  task :with_data => :environment do
135
- DataMigrate::DataMigrator.create_data_schema_table
161
+ DataMigrate::DataMigrator.assure_data_schema_table
136
162
  puts "Current Schema version: #{ActiveRecord::Migrator.current_version}"
137
163
  puts "Current Data version: #{DataMigrate::DataMigrator.current_version}"
138
164
  end
@@ -178,14 +204,20 @@ end
178
204
  namespace :data do
179
205
  desc 'Migrate data migrations (options: VERSION=x, VERBOSE=false)'
180
206
  task :migrate => :environment do
181
- DataMigrate::Tasks::DataMigrateTasks.migrate
207
+ original_db_config = ActiveRecord::Base.connection_db_config
208
+ ActiveRecord::Base.configurations.configs_for(env_name: ActiveRecord::Tasks::DatabaseTasks.env).each do |db_config|
209
+ ActiveRecord::Base.establish_connection(db_config)
210
+ DataMigrate::Tasks::DataMigrateTasks.migrate
211
+ end
182
212
  Rake::Task["data:dump"].invoke
213
+ ensure
214
+ ActiveRecord::Base.establish_connection(original_db_config)
183
215
  end
184
216
 
185
217
  namespace :migrate do
186
218
  desc 'Rollbacks the database one migration and re migrate up (options: STEP=x, VERSION=x).'
187
219
  task :redo => :environment do
188
- DataMigrate::DataMigrator.create_data_schema_table
220
+ DataMigrate::DataMigrator.assure_data_schema_table
189
221
  if ENV["VERSION"]
190
222
  Rake::Task["data:migrate:down"].invoke
191
223
  Rake::Task["data:migrate:up"].invoke
@@ -197,7 +229,7 @@ namespace :data do
197
229
 
198
230
  desc 'Runs the "up" for a given migration VERSION.'
199
231
  task :up => :environment do
200
- DataMigrate::DataMigrator.create_data_schema_table
232
+ DataMigrate::DataMigrator.assure_data_schema_table
201
233
  version = ENV["VERSION"] ? ENV["VERSION"].to_i : nil
202
234
  raise "VERSION is required" unless version
203
235
  DataMigrate::DataMigrator.run(:up, DataMigrate::DatabaseTasks.data_migrations_path, version)
@@ -208,20 +240,23 @@ namespace :data do
208
240
  task :down => :environment do
209
241
  version = ENV["VERSION"] ? ENV["VERSION"].to_i : nil
210
242
  raise "VERSION is required" unless version
211
- DataMigrate::DataMigrator.create_data_schema_table
243
+ DataMigrate::DataMigrator.assure_data_schema_table
212
244
  DataMigrate::DataMigrator.run(:down, DataMigrate::DatabaseTasks.data_migrations_path, version)
213
245
  Rake::Task["data:dump"].invoke
214
246
  end
215
247
 
216
248
  desc "Display status of data migrations"
217
249
  task :status => :environment do
218
- DataMigrate::Tasks::DataMigrateTasks.status
250
+ ActiveRecord::Base.configurations.configs_for(env_name: ActiveRecord::Tasks::DatabaseTasks.env).each do |db_config|
251
+ ActiveRecord::Base.establish_connection(db_config)
252
+ DataMigrate::Tasks::DataMigrateTasks.status(db_config)
253
+ end
219
254
  end
220
255
  end
221
256
 
222
257
  desc 'Rolls the schema back to the previous version (specify steps w/ STEP=n).'
223
258
  task :rollback => :environment do
224
- DataMigrate::DataMigrator.create_data_schema_table
259
+ DataMigrate::DataMigrator.assure_data_schema_table
225
260
  step = ENV['STEP'] ? ENV['STEP'].to_i : 1
226
261
  DataMigrate::DataMigrator.rollback(DataMigrate::DatabaseTasks.data_migrations_path, step)
227
262
  Rake::Task["data:dump"].invoke
@@ -229,7 +264,7 @@ namespace :data do
229
264
 
230
265
  desc 'Pushes the schema to the next version (specify steps w/ STEP=n).'
231
266
  task :forward => :environment do
232
- DataMigrate::DataMigrator.create_data_schema_table
267
+ DataMigrate::DataMigrator.assure_data_schema_table
233
268
  step = ENV['STEP'] ? ENV['STEP'].to_i : 1
234
269
  # TODO: No worky for .forward
235
270
  # DataMigrate::DataMigrator.forward('db/data/', step)
@@ -242,7 +277,7 @@ namespace :data do
242
277
 
243
278
  desc "Retrieves the current schema version number for data migrations"
244
279
  task :version => :environment do
245
- DataMigrate::DataMigrator.create_data_schema_table
280
+ DataMigrate::DataMigrator.assure_data_schema_table
246
281
  puts "Current data version: #{DataMigrate::DataMigrator.current_version}"
247
282
  end
248
283
 
@@ -254,7 +289,10 @@ namespace :data do
254
289
 
255
290
  desc "Create a db/data_schema.rb file that stores the current data version"
256
291
  task dump: :environment do
257
- DataMigrate::Tasks::DataMigrateTasks.dump
292
+ ActiveRecord::Base.configurations.configs_for(env_name: ActiveRecord::Tasks::DatabaseTasks.env).each do |db_config|
293
+ ActiveRecord::Base.establish_connection(db_config)
294
+ DataMigrate::Tasks::DataMigrateTasks.dump(db_config)
295
+ end
258
296
 
259
297
  # Allow this task to be called as many times as required. An example
260
298
  # is the migrate:redo task, which calls other two internally
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: data_migrate
3
3
  version: !ruby/object:Gem::Version
4
- version: 9.3.0
4
+ version: 10.0.0.rc1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew J Vargo
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2024-03-02 00:00:00.000000000 Z
13
+ date: 2023-04-23 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: activerecord
@@ -18,28 +18,28 @@ dependencies:
18
18
  requirements:
19
19
  - - ">="
20
20
  - !ruby/object:Gem::Version
21
- version: '6.1'
21
+ version: '6.0'
22
22
  type: :runtime
23
23
  prerelease: false
24
24
  version_requirements: !ruby/object:Gem::Requirement
25
25
  requirements:
26
26
  - - ">="
27
27
  - !ruby/object:Gem::Version
28
- version: '6.1'
28
+ version: '6.0'
29
29
  - !ruby/object:Gem::Dependency
30
30
  name: railties
31
31
  requirement: !ruby/object:Gem::Requirement
32
32
  requirements:
33
33
  - - ">="
34
34
  - !ruby/object:Gem::Version
35
- version: '6.1'
35
+ version: '6.0'
36
36
  type: :runtime
37
37
  prerelease: false
38
38
  version_requirements: !ruby/object:Gem::Requirement
39
39
  requirements:
40
40
  - - ">="
41
41
  - !ruby/object:Gem::Version
42
- version: '6.1'
42
+ version: '6.0'
43
43
  - !ruby/object:Gem::Dependency
44
44
  name: appraisal
45
45
  requirement: !ruby/object:Gem::Requirement
@@ -128,16 +128,16 @@ dependencies:
128
128
  name: sqlite3
129
129
  requirement: !ruby/object:Gem::Requirement
130
130
  requirements:
131
- - - ">="
131
+ - - "~>"
132
132
  - !ruby/object:Gem::Version
133
- version: '0'
133
+ version: 1.3.6
134
134
  type: :development
135
135
  prerelease: false
136
136
  version_requirements: !ruby/object:Gem::Requirement
137
137
  requirements:
138
- - - ">="
138
+ - - "~>"
139
139
  - !ruby/object:Gem::Version
140
- version: '0'
140
+ version: 1.3.6
141
141
  - !ruby/object:Gem::Dependency
142
142
  name: timecop
143
143
  requirement: !ruby/object:Gem::Requirement
@@ -198,20 +198,19 @@ files:
198
198
  - ".rspec"
199
199
  - ".rubocop.yml"
200
200
  - ".ruby-style.yml"
201
+ - ".ruby-version"
202
+ - ".travis.yml"
201
203
  - Appraisals
202
204
  - Changelog.md
203
205
  - Gemfile
204
- - Gemfile.lock
206
+ - Gemfile.rails6.1
205
207
  - LICENSE
206
208
  - README.md
207
209
  - Rakefile
208
210
  - data_migrate.gemspec
211
+ - gemfiles/rails_6.0.gemfile
209
212
  - gemfiles/rails_6.1.gemfile
210
- - gemfiles/rails_6.1.gemfile.lock
211
213
  - gemfiles/rails_7.0.gemfile
212
- - gemfiles/rails_7.0.gemfile.lock
213
- - gemfiles/rails_7.1.gemfile
214
- - gemfiles/rails_7.1.gemfile.lock
215
214
  - lib/capistrano/data_migrate.rb
216
215
  - lib/capistrano/data_migrate/migrate.rb
217
216
  - lib/data_migrate.rb
@@ -219,16 +218,14 @@ files:
219
218
  - lib/data_migrate/data_migrator.rb
220
219
  - lib/data_migrate/data_schema.rb
221
220
  - lib/data_migrate/data_schema_migration.rb
222
- - lib/data_migrate/database_configurations_wrapper.rb
223
221
  - lib/data_migrate/database_tasks.rb
222
+ - lib/data_migrate/legacy_migrator.rb
224
223
  - lib/data_migrate/migration_context.rb
225
- - lib/data_migrate/rails_helper.rb
226
224
  - lib/data_migrate/railtie.rb
227
225
  - lib/data_migrate/schema_dumper.rb
228
226
  - lib/data_migrate/schema_migration.rb
229
227
  - lib/data_migrate/status_service.rb
230
228
  - lib/data_migrate/tasks/data_migrate_tasks.rb
231
- - lib/data_migrate/test.rb
232
229
  - lib/data_migrate/version.rb
233
230
  - lib/generators/data_migrate.rb
234
231
  - lib/generators/data_migration/data_migration_generator.rb
@@ -240,6 +237,7 @@ files:
240
237
  - spec/data_migrate/data_schema_migration_spec.rb
241
238
  - spec/data_migrate/data_spec.rb
242
239
  - spec/data_migrate/database_tasks_spec.rb
240
+ - spec/data_migrate/legacy_migrator_spec.rb
243
241
  - spec/data_migrate/migration.rb
244
242
  - spec/data_migrate/migration_context_spec.rb
245
243
  - spec/data_migrate/schema_dumper_spec.rb
@@ -274,11 +272,11 @@ required_ruby_version: !ruby/object:Gem::Requirement
274
272
  version: '0'
275
273
  required_rubygems_version: !ruby/object:Gem::Requirement
276
274
  requirements:
277
- - - ">="
275
+ - - ">"
278
276
  - !ruby/object:Gem::Version
279
- version: '0'
277
+ version: 1.3.1
280
278
  requirements: []
281
- rubygems_version: 3.4.19
279
+ rubygems_version: 3.3.26
282
280
  signing_key:
283
281
  specification_version: 4
284
282
  summary: Rake tasks to migrate data alongside schema changes.
data/Gemfile.lock DELETED
@@ -1,184 +0,0 @@
1
- PATH
2
- remote: .
3
- specs:
4
- data_migrate (9.3.0)
5
- activerecord (>= 6.1)
6
- railties (>= 6.1)
7
-
8
- GEM
9
- remote: http://rubygems.org/
10
- specs:
11
- actionpack (7.1.3.2)
12
- actionview (= 7.1.3.2)
13
- activesupport (= 7.1.3.2)
14
- nokogiri (>= 1.8.5)
15
- racc
16
- rack (>= 2.2.4)
17
- rack-session (>= 1.0.1)
18
- rack-test (>= 0.6.3)
19
- rails-dom-testing (~> 2.2)
20
- rails-html-sanitizer (~> 1.6)
21
- actionview (7.1.3.2)
22
- activesupport (= 7.1.3.2)
23
- builder (~> 3.1)
24
- erubi (~> 1.11)
25
- rails-dom-testing (~> 2.2)
26
- rails-html-sanitizer (~> 1.6)
27
- activemodel (7.1.3.2)
28
- activesupport (= 7.1.3.2)
29
- activerecord (7.1.3.2)
30
- activemodel (= 7.1.3.2)
31
- activesupport (= 7.1.3.2)
32
- timeout (>= 0.4.0)
33
- activesupport (7.1.3.2)
34
- base64
35
- bigdecimal
36
- concurrent-ruby (~> 1.0, >= 1.0.2)
37
- connection_pool (>= 2.2.5)
38
- drb
39
- i18n (>= 1.6, < 2)
40
- minitest (>= 5.1)
41
- mutex_m
42
- tzinfo (~> 2.0)
43
- appraisal (2.5.0)
44
- bundler
45
- rake
46
- thor (>= 0.14.0)
47
- ast (2.4.2)
48
- base64 (0.2.0)
49
- bigdecimal (3.1.6)
50
- builder (3.2.4)
51
- childprocess (5.0.0)
52
- coderay (1.1.3)
53
- concurrent-ruby (1.2.3)
54
- connection_pool (2.4.1)
55
- crass (1.0.6)
56
- diff-lcs (1.5.1)
57
- drb (2.2.0)
58
- ruby2_keywords
59
- erubi (1.12.0)
60
- i18n (1.14.1)
61
- concurrent-ruby (~> 1.0)
62
- iniparse (1.5.0)
63
- io-console (0.7.2)
64
- irb (1.11.2)
65
- rdoc
66
- reline (>= 0.4.2)
67
- json (2.7.1)
68
- language_server-protocol (3.17.0.3)
69
- loofah (2.22.0)
70
- crass (~> 1.0.2)
71
- nokogiri (>= 1.12.0)
72
- method_source (1.0.0)
73
- minitest (5.22.2)
74
- mutex_m (0.2.0)
75
- nokogiri (1.16.2-arm64-darwin)
76
- racc (~> 1.4)
77
- nokogiri (1.16.2-x86_64-linux)
78
- racc (~> 1.4)
79
- overcommit (0.63.0)
80
- childprocess (>= 0.6.3, < 6)
81
- iniparse (~> 1.4)
82
- rexml (~> 3.2)
83
- parallel (1.24.0)
84
- parser (3.3.0.5)
85
- ast (~> 2.4.1)
86
- racc
87
- pry (0.14.2)
88
- coderay (~> 1.1)
89
- method_source (~> 1.0)
90
- psych (5.1.2)
91
- stringio
92
- racc (1.7.3)
93
- rack (3.0.9.1)
94
- rack-session (2.0.0)
95
- rack (>= 3.0.0)
96
- rack-test (2.1.0)
97
- rack (>= 1.3)
98
- rackup (2.1.0)
99
- rack (>= 3)
100
- webrick (~> 1.8)
101
- rails-dom-testing (2.2.0)
102
- activesupport (>= 5.0.0)
103
- minitest
104
- nokogiri (>= 1.6)
105
- rails-html-sanitizer (1.6.0)
106
- loofah (~> 2.21)
107
- nokogiri (~> 1.14)
108
- railties (7.1.3.2)
109
- actionpack (= 7.1.3.2)
110
- activesupport (= 7.1.3.2)
111
- irb
112
- rackup (>= 1.0.0)
113
- rake (>= 12.2)
114
- thor (~> 1.0, >= 1.2.2)
115
- zeitwerk (~> 2.6)
116
- rainbow (3.1.1)
117
- rake (13.1.0)
118
- rb-readline (0.5.5)
119
- rdoc (6.6.2)
120
- psych (>= 4.0.0)
121
- regexp_parser (2.9.0)
122
- reline (0.4.3)
123
- io-console (~> 0.5)
124
- rexml (3.2.6)
125
- rspec (3.13.0)
126
- rspec-core (~> 3.13.0)
127
- rspec-expectations (~> 3.13.0)
128
- rspec-mocks (~> 3.13.0)
129
- rspec-core (3.13.0)
130
- rspec-support (~> 3.13.0)
131
- rspec-expectations (3.13.0)
132
- diff-lcs (>= 1.2.0, < 2.0)
133
- rspec-support (~> 3.13.0)
134
- rspec-mocks (3.13.0)
135
- diff-lcs (>= 1.2.0, < 2.0)
136
- rspec-support (~> 3.13.0)
137
- rspec-support (3.13.1)
138
- rubocop (1.60.2)
139
- json (~> 2.3)
140
- language_server-protocol (>= 3.17.0)
141
- parallel (~> 1.10)
142
- parser (>= 3.3.0.2)
143
- rainbow (>= 2.2.2, < 4.0)
144
- regexp_parser (>= 1.8, < 3.0)
145
- rexml (>= 3.2.5, < 4.0)
146
- rubocop-ast (>= 1.30.0, < 2.0)
147
- ruby-progressbar (~> 1.7)
148
- unicode-display_width (>= 2.4.0, < 3.0)
149
- rubocop-ast (1.30.0)
150
- parser (>= 3.2.1.0)
151
- ruby-progressbar (1.13.0)
152
- ruby2_keywords (0.0.5)
153
- sqlite3 (1.7.2-arm64-darwin)
154
- sqlite3 (1.7.2-x86_64-linux)
155
- stringio (3.1.0)
156
- thor (1.3.1)
157
- timecop (0.9.8)
158
- timeout (0.4.1)
159
- tzinfo (2.0.6)
160
- concurrent-ruby (~> 1.0)
161
- unicode-display_width (2.5.0)
162
- webrick (1.8.1)
163
- zeitwerk (2.6.13)
164
-
165
- PLATFORMS
166
- arm64-darwin-22
167
- arm64-darwin-23
168
- x86_64-linux
169
-
170
- DEPENDENCIES
171
- appraisal
172
- data_migrate!
173
- overcommit
174
- pry
175
- rake
176
- rb-readline
177
- rspec
178
- rspec-core
179
- rubocop
180
- sqlite3
181
- timecop
182
-
183
- BUNDLED WITH
184
- 2.4.17