online_migrations 0.13.0 → 0.13.1
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8952366397c54505f364a353dde1d68e988ac4773e9b3663de790a75c8b860f3
|
4
|
+
data.tar.gz: 376dc6e760a2b07d55968a11097f9f81067bc72291718938d1102fafb46a73ea
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3e40ed5ab49e5d702c7d7cfebdb4264621375ad9affb67e8c3592814c4a832e75929c4ff718ce90709e64497226df3d9503a42babf56cfaad5ce973026f71d82
|
7
|
+
data.tar.gz: cdcbc9c26ac23fb975f21dd58c9826dab59c9571d074da06211dea2ffae72c3c57372722110ecd729ba649f21db551f58e8ca43689214f1235cd20669f033cf6
|
data/CHANGELOG.md
CHANGED
@@ -197,10 +197,7 @@ module OnlineMigrations
|
|
197
197
|
|
198
198
|
on_shard do
|
199
199
|
# rubocop:disable Lint/UnreachableLoop
|
200
|
-
iterator.each_batch(of: batch_size, column: batch_column_name, start: next_min_value) do |
|
201
|
-
if max_value.nil?
|
202
|
-
max_value = relation.pick(relation.arel_table[batch_column_name].maximum)
|
203
|
-
end
|
200
|
+
iterator.each_batch(of: batch_size, column: batch_column_name, start: next_min_value, finish: max_value) do |_relation, min_value, max_value|
|
204
201
|
batch_range = [min_value, max_value]
|
205
202
|
|
206
203
|
break
|
@@ -69,7 +69,7 @@ module OnlineMigrations
|
|
69
69
|
# efficient UPDATE queries, hence we get rid of it.
|
70
70
|
batch_relation = batch_relation.except(:order)
|
71
71
|
|
72
|
-
last_id = (last_row && last_row[column]) ||
|
72
|
+
last_id = (last_row && last_row[column]) || finish
|
73
73
|
|
74
74
|
# Retaining the results in the query cache would undermine the point of batching.
|
75
75
|
batch_relation.uncached { yield batch_relation, start_id, last_id }
|
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.13.
|
4
|
+
version: 0.13.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- fatkodima
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-01-
|
11
|
+
date: 2024-01-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|