ridgepole 0.9.2 → 0.9.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -0
- data/lib/ridgepole/diff.rb +7 -3
- data/lib/ridgepole/version.rb +1 -1
- data/spec/mysql/migrate/migrate_change_column7_spec.rb +11 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3453e48af2d76cbb35301fcc70d7177f0016c47f4279593b6adbf269190d0b01
|
4
|
+
data.tar.gz: e4e61ed5bbbfae92a0660244a4e021fc387d945ccd5e85971d20c1ff184dc79f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: aa213105207d7a0a73adae7254885966fb06b0e0cc22cec7e2e44f7bd2082f7a6b10b2e7d8b5c5822c57b333447cd8ebb591db691b95a541f1493adcf3d46153
|
7
|
+
data.tar.gz: 3e1a1c8bbcde1f7d313df1a151d5ca3096e1bba911a099cc4e8969b877941dd85061d2c3d18c17afff976c5119d3cc00f9c9966f9037af5365d8d5b0c87243c0
|
data/README.md
CHANGED
@@ -139,6 +139,8 @@ It defines DB schema using [Rails DSL](http://guides.rubyonrails.org/migrations.
|
|
139
139
|
* Support `t.foreign_key` ([pull#348](https://github.com/winebarrel/ridgepole/pull/348))
|
140
140
|
* `>= 0.9.2`
|
141
141
|
* Support `t.column index option` ([pull#353](https://github.com/winebarrel/ridgepole/pull/353))
|
142
|
+
* `>= 0.9.3`
|
143
|
+
* Fix `limit` option for `t.integer` ([pull#354](https://github.com/winebarrel/ridgepole/pull/453))
|
142
144
|
</details>
|
143
145
|
|
144
146
|
**Notice**
|
data/lib/ridgepole/diff.rb
CHANGED
@@ -399,9 +399,13 @@ module Ridgepole
|
|
399
399
|
if Ridgepole::ConnectionAdapters.mysql?
|
400
400
|
opts[:unsigned] = false unless opts.key?(:unsigned)
|
401
401
|
|
402
|
-
if
|
403
|
-
|
404
|
-
|
402
|
+
if attrs[:type] == :integer && opts[:limit]
|
403
|
+
min = Ridgepole::DefaultsLimit.default_limit(:integer, @options)
|
404
|
+
max = Ridgepole::DefaultsLimit.default_limit(:bigint, @options)
|
405
|
+
if min < opts[:limit] && opts[:limit] <= max
|
406
|
+
attrs[:type] = :bigint
|
407
|
+
opts.delete(:limit)
|
408
|
+
end
|
405
409
|
end
|
406
410
|
|
407
411
|
if opts[:size] && (attrs[:type] == :text || attrs[:type] == :blob || attrs[:type] == :binary)
|
data/lib/ridgepole/version.rb
CHANGED
@@ -5,7 +5,11 @@ describe 'Ridgepole::Client#diff -> migrate' do
|
|
5
5
|
let(:dsl) do
|
6
6
|
erbh(<<-ERB)
|
7
7
|
create_table "salaries", id: false, force: :cascade do |t|
|
8
|
-
t.integer "
|
8
|
+
t.integer "emp_no_int", limit: 4, null: false
|
9
|
+
t.integer "emp_no_bigint5", limit: 5, null: false
|
10
|
+
t.integer "emp_no_bigint6", limit: 6, null: false
|
11
|
+
t.integer "emp_no_bigint7", limit: 7, null: false
|
12
|
+
t.integer "emp_no_bigint8", limit: 8, null: false
|
9
13
|
t.float "salary", <%= i cond('< 5.2.0.beta2', limit: 24) %>, null: false
|
10
14
|
t.date "from_date", null: false
|
11
15
|
t.date "to_date", null: false
|
@@ -17,7 +21,12 @@ describe 'Ridgepole::Client#diff -> migrate' do
|
|
17
21
|
subject { client }
|
18
22
|
|
19
23
|
it {
|
20
|
-
expect(subject.dump).to match_ruby dsl
|
24
|
+
expect(subject.dump).to match_ruby dsl
|
25
|
+
.sub(/t.integer "emp_no_int", limit: 4/, 't.integer "emp_no_int"')
|
26
|
+
.sub(/t.integer "emp_no_bigint5", limit: 5/, 't.bigint "emp_no_bigint5"')
|
27
|
+
.sub(/t.integer "emp_no_bigint6", limit: 6/, 't.bigint "emp_no_bigint6"')
|
28
|
+
.sub(/t.integer "emp_no_bigint7", limit: 7/, 't.bigint "emp_no_bigint7"')
|
29
|
+
.sub(/t.integer "emp_no_bigint8", limit: 8/, 't.bigint "emp_no_bigint8"')
|
21
30
|
delta = subject.diff(dsl)
|
22
31
|
expect(delta.differ?).to be_falsey
|
23
32
|
}
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ridgepole
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Genki Sugawara
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-04-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|