online_migrations 0.8.0 → 0.8.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: 9bfe87b009fa9199b4deb0a1bf7e63dac043fa8f29c25f4f93c55fd136155f2d
|
4
|
+
data.tar.gz: 0a95c4b4de358769bce7d3855f7df67c08d027279b523d0ea550a383b60cd6a8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 95b0d869484b407b295426bf1b836f00ce71c297fc1ef35fe817e449f126ccbc7e7df512efc30c16cda9dfb9755c86e1b409f9787f40708341aba422128b0d60
|
7
|
+
data.tar.gz: 42b829796b7fd0503416460775ac1c7596fce43621667a9144cd06b9000e35f8054398cadbf82f370b3e8ca988bcd7ce53b505982e8e5b3ed7e6991c71f373aa
|
data/CHANGELOG.md
CHANGED
@@ -47,6 +47,7 @@ module OnlineMigrations
|
|
47
47
|
record(:"#{method}", args, &block) # record(:create_table, args, &block)
|
48
48
|
end # end
|
49
49
|
RUBY
|
50
|
+
ruby2_keywords(method) if respond_to?(:ruby2_keywords, true)
|
50
51
|
end
|
51
52
|
|
52
53
|
private
|
@@ -130,28 +131,21 @@ module OnlineMigrations
|
|
130
131
|
end
|
131
132
|
|
132
133
|
def invert_add_not_null_constraint(args)
|
133
|
-
|
134
|
-
|
135
|
-
options.delete(:validate)
|
136
|
-
[:remove_not_null_constraint, [table_name, column, **options]]
|
134
|
+
args.last.delete(:validate) if args.last.is_a?(Hash)
|
135
|
+
[:remove_not_null_constraint, args]
|
137
136
|
end
|
138
137
|
|
139
138
|
def invert_add_text_limit_constraint(args)
|
140
|
-
|
141
|
-
|
142
|
-
options.delete(:validate)
|
143
|
-
[:remove_text_limit_constraint, [table_name, column, **options]]
|
139
|
+
args.last.delete(:validate) if args.last.is_a?(Hash)
|
140
|
+
[:remove_text_limit_constraint, args]
|
144
141
|
end
|
145
142
|
|
146
143
|
def invert_remove_text_limit_constraint(args)
|
147
|
-
|
148
|
-
table_name, column, limit = args
|
149
|
-
|
150
|
-
unless limit
|
144
|
+
unless args[2]
|
151
145
|
raise ActiveRecord::IrreversibleMigration, "remove_text_limit_constraint is only reversible if given a limit."
|
152
146
|
end
|
153
147
|
|
154
|
-
[:add_text_limit_constraint,
|
148
|
+
[:add_text_limit_constraint, args]
|
155
149
|
end
|
156
150
|
end
|
157
151
|
end
|
@@ -89,11 +89,15 @@ module OnlineMigrations
|
|
89
89
|
# Ignore subqueries in conditions
|
90
90
|
unless value.is_a?(Arel::Nodes::SqlLiteral) && value.to_s =~ /select\s+/i
|
91
91
|
arel_column = model.arel_table[column_name]
|
92
|
-
|
92
|
+
if value.nil?
|
93
|
+
arel_column.not_eq(nil)
|
94
|
+
else
|
95
|
+
arel_column.not_eq(value).or(arel_column.eq(nil))
|
96
|
+
end
|
93
97
|
end
|
94
98
|
end.compact
|
95
99
|
|
96
|
-
batch_relation = model.where(conditions.inject(:
|
100
|
+
batch_relation = model.where(conditions.inject(:or))
|
97
101
|
batch_relation = yield batch_relation if block_given?
|
98
102
|
|
99
103
|
iterator = BatchIterator.new(batch_relation)
|
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.8.
|
4
|
+
version: 0.8.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- fatkodima
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-08-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|