online_migrations 0.19.5 → 0.19.6

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: 9cb60167b94f5ce8556b3f9835949c86f9be4c523eb2c35494de578dea31a2bf
4
- data.tar.gz: 20d9d6fcf509bbc25987a2e3bce165c927cacd03502aa908c02aba37dd284774
3
+ metadata.gz: cd8711d56259535675633074868019a5c4b3de068bb30d783c9ae16dc906afb1
4
+ data.tar.gz: 3b417e176d143092d69e4551c1f96a32e1a2acf1d74d268fc33f9b5a598be553
5
5
  SHA512:
6
- metadata.gz: 03f82fe701b6d2145963f1f2220ac9ed127dc826885455134afc3bb547197d21a1c0307156b6d8b5402c0a521332328eebf45d96a3bb2183804055d866cd3af2
7
- data.tar.gz: 94f0bfd73299897757a8b836a9cbd995bb9313c971a6e0076079b783955c26da239098b84df391096128fc0e060ba66ca69e61e16a84013c12d613c7fe4064ce
6
+ metadata.gz: ad26fd5662f2636479b697933042b8d7e60b4ee42f136ddeb8cff8256c65a4491b8017d09d2da849faf65cb6f8d4ecc95595816b7669c8364e9f31bbe75232c4
7
+ data.tar.gz: 21fec027462ff6f96baaf0fc65d186fc68fefbb50fd3de6af8f561aae691e6f9909d70d7053557d39f0a56ea498841816c2853cce0b1acef161411b2d968b196
data/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  ## master (unreleased)
2
2
 
3
+ ## 0.19.6 (2024-09-26)
4
+
5
+ - Fix `add_refernce_concurrently` when adding non polymorphic references
6
+ - Fix progress for background migrations with small number of records
7
+
3
8
  ## 0.19.5 (2024-09-20)
4
9
 
5
10
  - Fix `add_reference_concurrently` when adding polymorphic references
@@ -138,7 +138,7 @@ module OnlineMigrations
138
138
  progresses.sum.round(2)
139
139
  end
140
140
  elsif rows_count
141
- if rows_count > 0
141
+ if rows_count > 0 && rows_count > batch_size
142
142
  jobs_rows_count = migration_jobs.succeeded.sum(:batch_size)
143
143
  # The last migration job may need to process the amount of rows
144
144
  # less than the batch size, so we can get a value > 1.0.
@@ -183,14 +183,14 @@ module OnlineMigrations
183
183
  def retry
184
184
  if composite? && failed?
185
185
  children.failed.each(&:retry)
186
- running!
186
+ enqueued!
187
187
  true
188
188
  elsif failed?
189
189
  iterator = BatchIterator.new(migration_jobs.failed)
190
190
  iterator.each_batch(of: 100) do |batch|
191
191
  batch.each(&:retry)
192
192
  end
193
- running!
193
+ enqueued!
194
194
  true
195
195
  else
196
196
  false
@@ -81,7 +81,7 @@ module OnlineMigrations
81
81
  error_message: nil,
82
82
  backtrace: nil
83
83
  )
84
- migration.running! if migration.failed?
84
+ migration.enqueued! if migration.failed?
85
85
  end
86
86
  true
87
87
  else
@@ -655,7 +655,7 @@ module OnlineMigrations
655
655
  add_column(table_name, column_name, type, null: allow_null)
656
656
  end
657
657
 
658
- if !column_exists?(table_name, type_column_name)
658
+ if options[:polymorphic] && !column_exists?(table_name, type_column_name)
659
659
  allow_null = options[:polymorphic].is_a?(Hash) ? options[:polymorphic][:null] : true
660
660
  add_column(table_name, type_column_name, :string, null: allow_null)
661
661
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module OnlineMigrations
4
- VERSION = "0.19.5"
4
+ VERSION = "0.19.6"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: online_migrations
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.19.5
4
+ version: 0.19.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - fatkodima
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-09-19 00:00:00.000000000 Z
11
+ date: 2024-09-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord