data_migrate 9.4.1 → 11.2.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 (57) hide show
  1. checksums.yaml +4 -4
  2. data/Changelog.md +27 -1
  3. data/README.md +20 -13
  4. data/lib/data_migrate/data_migrator.rb +1 -1
  5. data/lib/data_migrate/data_schema.rb +6 -6
  6. data/lib/data_migrate/database_tasks.rb +84 -10
  7. data/lib/data_migrate/rails_helper.rb +15 -3
  8. data/lib/data_migrate/tasks/data_migrate_tasks.rb +8 -6
  9. data/lib/data_migrate/version.rb +1 -1
  10. data/lib/generators/data_migration/data_migration_generator.rb +2 -1
  11. data/tasks/databases.rake +7 -0
  12. metadata +2 -47
  13. data/.github/workflows/build.yml +0 -35
  14. data/.github/workflows/gempush.yml +0 -28
  15. data/.gitignore +0 -12
  16. data/.hound.yml +0 -4
  17. data/.overcommit.yml +0 -21
  18. data/.rbenv-gemsets +0 -2
  19. data/.rspec +0 -3
  20. data/.rubocop.yml +0 -2
  21. data/.ruby-style.yml +0 -1061
  22. data/Appraisals +0 -11
  23. data/Gemfile +0 -3
  24. data/Gemfile.lock +0 -184
  25. data/Rakefile +0 -2
  26. data/data_migrate.gemspec +0 -41
  27. data/gemfiles/rails_6.1.gemfile +0 -7
  28. data/gemfiles/rails_6.1.gemfile.lock +0 -229
  29. data/gemfiles/rails_7.0.gemfile +0 -7
  30. data/gemfiles/rails_7.0.gemfile.lock +0 -230
  31. data/gemfiles/rails_7.1.gemfile +0 -7
  32. data/gemfiles/rails_7.1.gemfile.lock +0 -263
  33. data/lib/data_migrate/test.rb +0 -14
  34. data/screenshot.png +0 -0
  35. data/spec/data_migrate/config_spec.rb +0 -69
  36. data/spec/data_migrate/data_migrator_spec.rb +0 -83
  37. data/spec/data_migrate/data_schema_migration_spec.rb +0 -33
  38. data/spec/data_migrate/data_spec.rb +0 -74
  39. data/spec/data_migrate/database_tasks_spec.rb +0 -105
  40. data/spec/data_migrate/migration.rb +0 -17
  41. data/spec/data_migrate/migration_context_spec.rb +0 -108
  42. data/spec/data_migrate/schema_dumper_spec.rb +0 -36
  43. data/spec/data_migrate/schema_migration_spec.rb +0 -104
  44. data/spec/data_migrate/status_service_spec.rb +0 -76
  45. data/spec/data_migrate/tasks/data_migrate_tasks_spec.rb +0 -129
  46. data/spec/db/data/20091231235959_some_name.rb +0 -9
  47. data/spec/db/data/20171231235959_super_update.rb +0 -9
  48. data/spec/db/data/20181128000207_excluded_file.rb.other_ext +0 -1
  49. data/spec/db/data/partial_schema/data_schema.rb +0 -1
  50. data/spec/db/data/partial_schema/test_data_schema.rb +0 -1
  51. data/spec/db/data/schema/data_schema.rb +0 -1
  52. data/spec/db/data/schema/test_data_schema.rb +0 -1
  53. data/spec/db/migrate/20131111111111_late_migration.rb +0 -9
  54. data/spec/db/migrate/20202020202011_db_migration.rb +0 -9
  55. data/spec/generators/data_migration/data_migration_generator_spec.rb +0 -101
  56. data/spec/spec_helper.rb +0 -28
  57. data/tasks/.gitkeep +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: aa16e421f2f5d046c5e78678b226574ddaeca7345bfcff5f8ab69091fb901f3c
4
- data.tar.gz: 91d60c54724dc47e6aac6f7638275c005c0f27f052741c00fbed0f15fb8056b7
3
+ metadata.gz: 907383933e031d0a1da7bad6dd3a43807794c0abeb27313af27e59ed8d802f3a
4
+ data.tar.gz: 1ddf826962f7078972ca9a234a723646d7744a41990dbe38550155fc0276fca3
5
5
  SHA512:
6
- metadata.gz: e0585dd9cc369cfbb980c609d1c7f1cc286a3109f799303d1518cca460f1e41b89df484154426e8e6798cd674f520241d19ab4bd2343bb0800e429de78b7d379
7
- data.tar.gz: 52aeb1ce48bcf2644f8c4640b99d5dbb98bee62e10fa5f3a20fabff41eb3dc833c346c39b51245a128095eb75231d588ca734092056aedbff62bfa1df6512888
6
+ metadata.gz: e9e79dd56bda8e5f2afecb79f940eb17d7b5439c1d07b38d67943d58fc0ebaf159283d4478ac13925a2ee399097f6825b519052d3fea9f7b04c659a98647e75f
7
+ data.tar.gz: '0959a1bcf969cbc7834c839eca029d1416ff287ea2927a8ae0493a7880fb6910adea4baf5a2d162bd4cce35f80b610dc2f9d671cf77cf6583a699a96196871de'
data/Changelog.md CHANGED
@@ -1,7 +1,33 @@
1
1
  # Changelog
2
2
 
3
+ # 11.2.0
4
+
5
+ - Remove committed Gemfile.lock, reduce bundled file list when running `gem install` https://github.com/ilyakatz/data-migrate/pull/351
6
+ - [Bump actionpack from 7.1.3.4 to 7.1.4.1](https://github.com/ilyakatz/data-migrate/pull/348)
7
+ - [Bump rexml from 3.3.6 to 3.3.9](https://github.com/ilyakatz/data-migrate/pull/349)
8
+ - Fix db_config_with_versions arity change and backport https://github.com/ilyakatz/data-migrate/pull/337
9
+
10
+ # 11.1.0
11
+ - Allow multiple data migration paths https://github.com/ilyakatz/data-migrate/pull/331
12
+ - Fix db:prepare:with_data task on [Rails 7.2](https://github.com/ilyakatz/data-migrate/pull/339)
13
+ - Fix ConnectionPool deprecation warnings on [Rails 7.2](https://github.com/ilyakatz/data-migrate/pull/341)
14
+ - Add Rails 8.0 to testing grounds https://github.com/ilyakatz/data-migrate/pull/341
15
+ - [Bump webrick from 1.8.1 to 1.8.2](https://github.com/ilyakatz/data-migrate/pull/345)
16
+
17
+ # 11.0.0
18
+ - [Update rexml to 3.3.6](https://github.com/ilyakatz/data-migrate/pull/329)
19
+ - Fixes a bug which ignored migrations on [Rails 7.1 and higher](https://github.com/ilyakatz/data-migrate/pull/326)
20
+
21
+ # 11.0.0rc
22
+ - Remove Ruby 3.0 from build matrix
23
+ - Support Rails 7.2.0 https://github.com/ilyakatz/data-migrate/pull/312
24
+ - Update gemfile.lock builds
25
+
26
+ ## 9.4.2
27
+ - Fix db:prepare:with_data task
28
+
3
29
  ## 9.4.1
4
- - Add db:prepare task
30
+ - Add db:prepare task
5
31
 
6
32
  ## 9.4.0
7
33
  - Reset model schema cache before each data migration https://github.com/ilyakatz/data-migrate/pull/307
data/README.md CHANGED
@@ -36,8 +36,13 @@ table to track all migrations.
36
36
 
37
37
  ## Rails Support
38
38
 
39
- Support Rails 6.1 through 7.1
39
+ Support Rails 6.1 through 7.2
40
40
 
41
+ For **Rails 6.0** support, please use gem version `9.1.x`:
42
+
43
+ ```ruby
44
+ gem 'data_migrate', '~> 9.1.0'
45
+ ```
41
46
 
42
47
  #### v1
43
48
 
@@ -86,6 +91,7 @@ You can generate a data migration as you would a schema migration:
86
91
  rake db:migrate:status:with_data # Display status of data and schema migrations
87
92
  rake db:migrate:up:with_data # Runs the "up" for a given migration VERSION
88
93
  rake db:migrate:with_data # Migrate the database data and schema (options: VERSION=x, VERBOSE=false)
94
+ rake db:prepare:with_data # Runs setup if database does not exist, or runs data and schema migrations if it does
89
95
  rake db:rollback:with_data # Rolls the schema back to the previous version (specify steps w/ STEP=n)
90
96
  rake db:schema:load:with_data # Load both schema.rb and data_schema.rb file into the database
91
97
  rake db:structure:load:with_data # Load both structure.sql and data_schema.rb file into the database
@@ -138,19 +144,12 @@ From now on capistrano will run `rake db:migrate:with_data` in every deploy.
138
144
  ## Rails Engines support
139
145
 
140
146
  This gem also has a initial support for adding data migrations inside Rails engines.
141
- Inside the Engine's class initializer (the one that inherits from `Rails::Engine`, usually inside `engines/ENGINE_NAME/lib/engine.rb`) you need to add something like this:
142
-
147
+ Just add your engines directory pattern to data_migrations initializer, for example
148
+ in the case your engines are located in `engines` folder you can set it up like this:
143
149
 
144
150
  ```ruby
145
- module EngineName
146
- class Engine < ::Rails::Engine
147
- initializer :engine_name do |app|
148
- ::DataMigrate.configure do |data_migrate|
149
- default_path = ::DataMigrate::Config.new.data_migrations_path
150
- data_migrate.data_migrations_path = [default_path, root.join('db', 'data')]
151
- end
152
- end
153
- end
151
+ DataMigrate.configure do |config|
152
+ config.data_migrations_path = ['db/data'] + Dir['engines/**/db/data']
154
153
  end
155
154
  ```
156
155
 
@@ -163,12 +162,20 @@ Then, in the Engine's `db/data` folder, you can add data migrations and run them
163
162
  Run tests for a specific version of Rails
164
163
 
165
164
  ```
166
- bundle exec appraisal install
167
165
  bundle exec appraisal rails-6.1 rspec
168
166
  bundle exec appraisal rails-7.0 rspec
169
167
  bundle exec appraisal rails-7.1 rspec
168
+ bundle exec appraisal rails-7.2 rspec
170
169
  ```
171
170
 
171
+ ## Releasing new version
172
+
173
+ 1. Create a new tag, eg `git tag 9.4.1`
174
+ 1. Go to https://github.com/ilyakatz/data-migrate/tags
175
+ 1. Click "Create release" under 9.4.1
176
+ 1. CLick "Generate release notes"
177
+ 1. Click "Publish release"
178
+
172
179
  ## Thanks
173
180
 
174
181
  [Andrew J Vargo](http://github.com/ajvargo) Andrew was the original creator and maintainer of this project!
@@ -12,7 +12,7 @@ module DataMigrate
12
12
 
13
13
  class << self
14
14
  def migrations_paths
15
- [DataMigrate.config.data_migrations_path]
15
+ Array.wrap(DataMigrate.config.data_migrations_path)
16
16
  end
17
17
 
18
18
  def create_data_schema_table
@@ -29,13 +29,13 @@ module DataMigrate
29
29
  end
30
30
 
31
31
  def versions
32
- @versions ||= begin
33
- versions = []
34
- Dir.foreach(DataMigrate::DataMigrator.full_migrations_path) do |file|
35
- match_data = DataMigrate::DataMigrator.match(file)
36
- versions << match_data[1].to_i if match_data
32
+ @versions ||= Set.new.tap do |versions|
33
+ DataMigrate::DataMigrator.migrations_paths.each do |path|
34
+ Dir.foreach(path) do |file|
35
+ match_data = DataMigrate::DataMigrator.match(file)
36
+ versions << match_data[1].to_i if match_data
37
+ end
37
38
  end
38
- versions
39
39
  end
40
40
  end
41
41
 
@@ -10,21 +10,21 @@ module DataMigrate
10
10
  extend self
11
11
 
12
12
  # These method are only introduced in Rails 7.1
13
- unless respond_to?(:with_temporary_connection_for_each)
14
- def with_temporary_connection_for_each(env: ActiveRecord::Tasks::DatabaseTasks.env, name: nil, &block) # :nodoc:
13
+ unless respond_to?(:with_temporary_pool_for_each)
14
+ def with_temporary_pool_for_each(env: ActiveRecord::Tasks::DatabaseTasks.env, name: nil, &block) # :nodoc:
15
15
  if name
16
16
  db_config = ActiveRecord::Base.configurations.configs_for(env_name: env, name: name)
17
- with_temporary_connection(db_config, &block)
17
+ with_temporary_pool(db_config, &block)
18
18
  else
19
19
  ActiveRecord::Base.configurations.configs_for(env_name: env, name: name).each do |db_config|
20
- with_temporary_connection(db_config, &block)
20
+ with_temporary_pool(db_config, &block)
21
21
  end
22
22
  end
23
23
  end
24
24
 
25
- def with_temporary_connection(db_config) # :nodoc:
25
+ def with_temporary_connection(db_config, &block) # :nodoc:
26
26
  with_temporary_pool(db_config) do |pool|
27
- yield pool.connection
27
+ pool.with_connection(&block)
28
28
  end
29
29
  end
30
30
 
@@ -49,8 +49,8 @@ module DataMigrate
49
49
  def db_configs_with_versions
50
50
  db_configs_with_versions = Hash.new { |h, k| h[k] = [] }
51
51
 
52
- with_temporary_connection_for_each do |conn|
53
- db_config = conn.pool.db_config
52
+ with_temporary_pool_for_each do |pool|
53
+ db_config = pool.db_config
54
54
  if db_config.primary?
55
55
  versions_to_run = DataMigrate::DatabaseTasks.pending_data_migrations.map { |m| m[:version] }
56
56
  target_version = ActiveRecord::Tasks::DatabaseTasks.target_version
@@ -179,9 +179,16 @@ module DataMigrate
179
179
 
180
180
  ActiveRecord::Migration.verbose = ENV["VERBOSE"] ? ENV["VERBOSE"] == "true" : true
181
181
 
182
- db_configs = ActiveRecord::Base.configurations.configs_for(env_name: ActiveRecord::Tasks::DatabaseTasks.env)
182
+ # 7.2 removes the param for db_configs_with_versions in https://github.com/rails/rails/commit/9572fcb4a0bd5396436689a6a42613886871cd81
183
+ # 7.1 stable backported the change in https://github.com/rails/rails/commit/c53ec4b60980036b43528829d4b0b7457f759224
184
+ schema_mapped_versions = if Gem::Dependency.new("railties", ">= 7.1.4").match?("railties", Gem.loaded_specs["railties"].version, true)
185
+ ActiveRecord::Tasks::DatabaseTasks.db_configs_with_versions
186
+ else
187
+ db_configs = ActiveRecord::Base.configurations.configs_for(env_name: ActiveRecord::Tasks::DatabaseTasks.env)
188
+
189
+ ActiveRecord::Tasks::DatabaseTasks.db_configs_with_versions(db_configs)
190
+ end
183
191
 
184
- schema_mapped_versions = ActiveRecord::Tasks::DatabaseTasks.db_configs_with_versions(db_configs)
185
192
  data_mapped_versions = DataMigrate::DatabaseTasks.db_configs_with_versions
186
193
 
187
194
  mapped_versions = schema_mapped_versions.merge(data_mapped_versions) do |_key, schema_db_configs, data_db_configs|
@@ -204,5 +211,72 @@ module DataMigrate
204
211
  end
205
212
  end
206
213
  end
214
+
215
+ def self.prepare_all_with_data
216
+ seed = false
217
+
218
+ each_current_configuration(env) do |db_config|
219
+ next unless primary?(db_config)
220
+
221
+ with_temporary_pool(db_config) do |pool|
222
+ unless database_exists?(pool.connection)
223
+ create(db_config)
224
+ if File.exist?(schema_dump_path(db_config))
225
+ load_schema(db_config, schema_format, nil)
226
+ load_schema_current(
227
+ :ruby,
228
+ ENV["DATA_SCHEMA"]
229
+ )
230
+ end
231
+
232
+ seed = true
233
+ end
234
+
235
+ migrate_with_data
236
+ if dump_schema_after_migration?
237
+ dump_schema(db_config)
238
+ DataMigrate::Tasks::DataMigrateTasks.dump
239
+ end
240
+ end
241
+ end
242
+
243
+ load_seed if seed
244
+ end
245
+
246
+ private
247
+
248
+ def database_exists?(connection)
249
+ if connection.respond_to?(:database_exists?) # Rails 7.1+
250
+ connection.database_exists?
251
+ else
252
+ connection.table_exists?(ActiveRecord::SchemaMigration.table_name)
253
+ end
254
+ rescue ActiveRecord::NoDatabaseError
255
+ false
256
+ end
257
+
258
+ def primary?(db_config)
259
+ if db_config.respond_to?(:primary?) # Rails 7.0+
260
+ db_config.primary?
261
+ else
262
+ db_config.name == "primary"
263
+ end
264
+ end
265
+
266
+ def dump_schema_after_migration?
267
+ if ActiveRecord.respond_to?(:dump_schema_after_migration)
268
+ ActiveRecord.dump_schema_after_migration
269
+ else
270
+ ActiveRecord::Base.dump_schema_after_migration
271
+ end
272
+ end
273
+
274
+ def schema_format
275
+ if ActiveRecord.respond_to?(:schema_format)
276
+ ActiveRecord.schema_format
277
+ else
278
+ ActiveRecord::Base.schema_format
279
+ end
280
+ end
207
281
  end
208
282
  end
@@ -1,6 +1,12 @@
1
1
  module DataMigrate
2
2
  class RailsHelper
3
3
  class << self
4
+ def rails_version_equal_to_or_higher_than_7_2
5
+ return @equal_to_or_higher_than_7_2 if defined?(@equal_to_or_higher_than_7_2)
6
+
7
+ @equal_to_or_higher_than_7_2 = Gem::Dependency.new("railties", ">= 7.2.0.alpha").match?("railties", Gem.loaded_specs["railties"].version, true)
8
+ end
9
+
4
10
  def rails_version_equal_to_or_higher_than_7_1
5
11
  return @equal_to_or_higher_than_7_1 if defined?(@equal_to_or_higher_than_7_1)
6
12
 
@@ -14,7 +20,9 @@ module DataMigrate
14
20
  end
15
21
 
16
22
  def internal_metadata
17
- if rails_version_equal_to_or_higher_than_7_1
23
+ if rails_version_equal_to_or_higher_than_7_2
24
+ ActiveRecord::Base.connection_pool.internal_metadata
25
+ elsif rails_version_equal_to_or_higher_than_7_1
18
26
  ActiveRecord::Base.connection.internal_metadata
19
27
  else
20
28
  ActiveRecord::InternalMetadata
@@ -22,7 +30,9 @@ module DataMigrate
22
30
  end
23
31
 
24
32
  def schema_migration
25
- if rails_version_equal_to_or_higher_than_7_1
33
+ if rails_version_equal_to_or_higher_than_7_2
34
+ ActiveRecord::Base.connection_pool.schema_migration
35
+ elsif rails_version_equal_to_or_higher_than_7_1
26
36
  ActiveRecord::Base.connection.schema_migration
27
37
  else
28
38
  ActiveRecord::SchemaMigration
@@ -54,7 +64,9 @@ module DataMigrate
54
64
  end
55
65
 
56
66
  def data_schema_migration
57
- if rails_version_equal_to_or_higher_than_7_1
67
+ if rails_version_equal_to_or_higher_than_7_2
68
+ DataMigrate::DataSchemaMigration.new(ActiveRecord::Tasks::DatabaseTasks.migration_connection_pool)
69
+ elsif rails_version_equal_to_or_higher_than_7_1
58
70
  DataMigrate::DataSchemaMigration.new(ActiveRecord::Tasks::DatabaseTasks.migration_connection)
59
71
  else
60
72
  DataMigrate::DataSchemaMigration
@@ -6,7 +6,7 @@ module DataMigrate
6
6
  extend self
7
7
 
8
8
  def migrations_paths
9
- @migrations_paths ||= DataMigrate.config.data_migrations_path
9
+ @migrations_paths ||= Array.wrap(DataMigrate.config.data_migrations_path)
10
10
  end
11
11
 
12
12
  def dump
@@ -55,11 +55,13 @@ module DataMigrate
55
55
  db_list_schema = DataMigrate::RailsHelper.schema_migration_versions
56
56
  file_list = []
57
57
 
58
- Dir.foreach(File.join(Rails.root, migrations_paths)) do |file|
59
- # only files matching "20091231235959_some_name.rb" pattern
60
- if match_data = /(\d{14})_(.+)\.rb/.match(file)
61
- status = db_list_data.delete(match_data[1]) ? 'up' : 'down'
62
- file_list << [status, match_data[1], match_data[2], 'data']
58
+ migrations_paths.each do |path|
59
+ Dir.foreach(File.join(Rails.root, path)) do |file|
60
+ # only files matching "20091231235959_some_name.rb" pattern
61
+ if match_data = /(\d{14})_(.+)\.rb/.match(file)
62
+ status = db_list_data.delete(match_data[1]) ? 'up' : 'down'
63
+ file_list << [status, match_data[1], match_data[2], 'data']
64
+ end
63
65
  end
64
66
  end
65
67
 
@@ -1,3 +1,3 @@
1
1
  module DataMigrate
2
- VERSION = "9.4.1".freeze
2
+ VERSION = "11.2.0".freeze
3
3
  end
@@ -38,8 +38,9 @@ module DataMigrate
38
38
  File.join(data_migrations_path, "#{file_name}.rb")
39
39
  end
40
40
 
41
+ # Use the first path in the data_migrations_path as the target directory
41
42
  def data_migrations_path
42
- DataMigrate.config.data_migrations_path
43
+ Array.wrap(DataMigrate.config.data_migrations_path).first
43
44
  end
44
45
  end
45
46
  end
data/tasks/databases.rake CHANGED
@@ -146,6 +146,13 @@ namespace :db do
146
146
  end
147
147
  end
148
148
  end
149
+
150
+ namespace :prepare do
151
+ desc "Runs setup if database does not exist, or runs data and schema migrations if it does"
152
+ task with_data: :environment do
153
+ DataMigrate::DatabaseTasks.prepare_all_with_data
154
+ end
155
+ end
149
156
  end
150
157
 
151
158
  namespace :data do
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.4.1
4
+ version: 11.2.0
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-08-13 00:00:00.000000000 Z
13
+ date: 2024-11-14 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: activerecord
@@ -189,29 +189,9 @@ executables: []
189
189
  extensions: []
190
190
  extra_rdoc_files: []
191
191
  files:
192
- - ".github/workflows/build.yml"
193
- - ".github/workflows/gempush.yml"
194
- - ".gitignore"
195
- - ".hound.yml"
196
- - ".overcommit.yml"
197
- - ".rbenv-gemsets"
198
- - ".rspec"
199
- - ".rubocop.yml"
200
- - ".ruby-style.yml"
201
- - Appraisals
202
192
  - Changelog.md
203
- - Gemfile
204
- - Gemfile.lock
205
193
  - LICENSE
206
194
  - README.md
207
- - Rakefile
208
- - data_migrate.gemspec
209
- - gemfiles/rails_6.1.gemfile
210
- - gemfiles/rails_6.1.gemfile.lock
211
- - 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
195
  - lib/capistrano/data_migrate.rb
216
196
  - lib/capistrano/data_migrate/migrate.rb
217
197
  - lib/data_migrate.rb
@@ -228,36 +208,11 @@ files:
228
208
  - lib/data_migrate/schema_migration.rb
229
209
  - lib/data_migrate/status_service.rb
230
210
  - lib/data_migrate/tasks/data_migrate_tasks.rb
231
- - lib/data_migrate/test.rb
232
211
  - lib/data_migrate/version.rb
233
212
  - lib/generators/data_migrate.rb
234
213
  - lib/generators/data_migration/data_migration_generator.rb
235
214
  - lib/generators/data_migration/templates/data_migration.rb
236
215
  - lib/generators/data_migration/templates/migration.rb
237
- - screenshot.png
238
- - spec/data_migrate/config_spec.rb
239
- - spec/data_migrate/data_migrator_spec.rb
240
- - spec/data_migrate/data_schema_migration_spec.rb
241
- - spec/data_migrate/data_spec.rb
242
- - spec/data_migrate/database_tasks_spec.rb
243
- - spec/data_migrate/migration.rb
244
- - spec/data_migrate/migration_context_spec.rb
245
- - spec/data_migrate/schema_dumper_spec.rb
246
- - spec/data_migrate/schema_migration_spec.rb
247
- - spec/data_migrate/status_service_spec.rb
248
- - spec/data_migrate/tasks/data_migrate_tasks_spec.rb
249
- - spec/db/data/20091231235959_some_name.rb
250
- - spec/db/data/20171231235959_super_update.rb
251
- - spec/db/data/20181128000207_excluded_file.rb.other_ext
252
- - spec/db/data/partial_schema/data_schema.rb
253
- - spec/db/data/partial_schema/test_data_schema.rb
254
- - spec/db/data/schema/data_schema.rb
255
- - spec/db/data/schema/test_data_schema.rb
256
- - spec/db/migrate/20131111111111_late_migration.rb
257
- - spec/db/migrate/20202020202011_db_migration.rb
258
- - spec/generators/data_migration/data_migration_generator_spec.rb
259
- - spec/spec_helper.rb
260
- - tasks/.gitkeep
261
216
  - tasks/databases.rake
262
217
  homepage: https://github.com/ilyakatz/data-migrate
263
218
  licenses:
@@ -1,35 +0,0 @@
1
- name: CI
2
-
3
- on:
4
- - push
5
- - pull_request
6
-
7
- jobs:
8
- test:
9
- strategy:
10
- fail-fast: false
11
- matrix:
12
- os: [ "ubuntu-20.04" ]
13
- ruby:
14
- - '3.0'
15
- - '3.1'
16
- - '3.2'
17
- - '3.3'
18
- gemfile:
19
- - gemfiles/rails_6.1.gemfile
20
- - gemfiles/rails_7.0.gemfile
21
- - gemfiles/rails_7.1.gemfile
22
- runs-on: ubuntu-latest
23
- env:
24
- BUNDLE_GEMFILE: ${{ matrix.gemfile }}
25
- RAILS_ENV: test
26
- steps:
27
- - name: Checkout code
28
- uses: actions/checkout@v3
29
- - name: Set up Ruby
30
- uses: ruby/setup-ruby@v1
31
- with:
32
- ruby-version: ${{ matrix.ruby }}
33
- bundler-cache: true
34
- - name: Run tests
35
- run: bundle exec rspec
@@ -1,28 +0,0 @@
1
- name: Release Gem
2
-
3
- on:
4
- release:
5
- types: [released]
6
-
7
- jobs:
8
- build:
9
- name: Build + Publish
10
- runs-on: ubuntu-latest
11
-
12
- steps:
13
- - uses: actions/checkout@master
14
- - name: Set up Ruby 3.2
15
- uses: ruby/setup-ruby@v1
16
- with:
17
- ruby-version: '3.2'
18
-
19
- - name: Publish to RubyGems
20
- run: |
21
- mkdir -p $HOME/.gem
22
- touch $HOME/.gem/credentials
23
- chmod 0600 $HOME/.gem/credentials
24
- printf -- "---\n:rubygems_api_key: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
25
- gem build *.gemspec
26
- gem push *.gem
27
- env:
28
- GEM_HOST_API_KEY: ${{secrets.RUBYGEMS_AUTH_TOKEN}}
data/.gitignore DELETED
@@ -1,12 +0,0 @@
1
- /.rvmrc
2
- *.gem
3
- gemfiles/.bundle
4
- spec/db/test.db
5
- spec/db/other_test.db
6
- spec/db/data_schema.rb
7
- .vscode/
8
- .DS_Store
9
- .ruby-gemset
10
- .ruby-version
11
- .idea/
12
- vendor/
data/.hound.yml DELETED
@@ -1,4 +0,0 @@
1
- fail_on_violations: true
2
-
3
- ruby:
4
- config_file: .rubocop.yml
data/.overcommit.yml DELETED
@@ -1,21 +0,0 @@
1
- # Use this file to configure the Overcommit hooks you wish to use. This will
2
- # extend the default configuration defined in:
3
- # https://github.com/brigade/overcommit/blob/master/config/default.yml
4
- #
5
- # At the topmost level of this YAML file is a key representing type of hook
6
- # being run (e.g. pre-commit, commit-msg, etc.). Within each type you can
7
- # customize each hook, such as whether to only run it on certain files (via
8
- # `include`), whether to only display output if it fails (via `quiet`), etc.
9
- #
10
- # For a complete list of hooks, see:
11
- # https://github.com/brigade/overcommit/tree/master/lib/overcommit/hook
12
- #
13
- # For a complete list of options that you can use to customize hooks, see:
14
- # https://github.com/brigade/overcommit#configuration
15
- #
16
- # Uncomment the following lines to make the configuration take effect.
17
-
18
- PreCommit:
19
- RuboCop:
20
- enabled: true
21
- on_warn: fail # Treat all warnings as failures
data/.rbenv-gemsets DELETED
@@ -1,2 +0,0 @@
1
- data-migrate
2
- -global
data/.rspec DELETED
@@ -1,3 +0,0 @@
1
- --color
2
- --format d
3
-
data/.rubocop.yml DELETED
@@ -1,2 +0,0 @@
1
- # Use same configration as used by HoundCI
2
- inherit_from: .ruby-style.yml