ridgepole 0.7.0.beta20 → 0.7.0.beta21
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4d0d05b6e86c04feb7e26a6e04a7134c3ff207a9
|
4
|
+
data.tar.gz: 2254a9e116f12e0f44965c244cd24fd03156425c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 43d4a18863fe6e7d525f7c5e1a16a3feef0f0d41a175235c175c0257d8ddc137ef9f9d03d6e424cd8e3713f45ba61f39e23dc3c503ce7829db38a2ba19987c64
|
7
|
+
data.tar.gz: b6ce4968bc3d179b2134953e7b1c716bc26e09570438771599db78673459f64a1f998ba417c530281e5319e693ee3ef975c90be46149ccfc6c62bfc4538b5b21
|
data/README.md
CHANGED
@@ -9,7 +9,7 @@ It defines DB schema using [Rails DSL](http://guides.rubyonrails.org/migrations.
|
|
9
9
|
[![Build Status](https://travis-ci.org/winebarrel/ridgepole.svg?branch=0.6)](https://travis-ci.org/winebarrel/ridgepole)
|
10
10
|
[![Coverage Status](https://coveralls.io/repos/github/winebarrel/ridgepole/badge.svg?branch=0.6)](https://coveralls.io/github/winebarrel/ridgepole?branch=0.6)
|
11
11
|
|
12
|
-
[![Edge Version](https://img.shields.io/badge/edge_version-0.7.0.
|
12
|
+
[![Edge Version](https://img.shields.io/badge/edge_version-0.7.0.beta21-brightgreen.svg)](https://rubygems.org/gems/ridgepole/versions/0.7.0.beta21)
|
13
13
|
[![Build Status](https://travis-ci.org/winebarrel/ridgepole.svg?branch=0.7)](https://travis-ci.org/winebarrel/ridgepole)
|
14
14
|
[![Coverage Status](https://coveralls.io/repos/github/winebarrel/ridgepole/badge.svg?branch=0.7)](https://coveralls.io/github/winebarrel/ridgepole?branch=0.7)
|
15
15
|
|
data/lib/ridgepole/diff.rb
CHANGED
@@ -128,6 +128,11 @@ class Ridgepole::Diff
|
|
128
128
|
table_delta[:table_options] = to_options
|
129
129
|
end
|
130
130
|
|
131
|
+
if @options[:dump_without_table_options]
|
132
|
+
from.delete(:options)
|
133
|
+
to.delete(:options)
|
134
|
+
end
|
135
|
+
|
131
136
|
unless from == to
|
132
137
|
@logger.warn(<<-EOS)
|
133
138
|
[WARNING] No difference of schema configuration for table `#{table_name}` but table options differ.
|
@@ -517,13 +522,11 @@ class Ridgepole::Diff
|
|
517
522
|
parent_label = "#{parent_table}.id"
|
518
523
|
child_label = "#{child_table}.#{column_name}"
|
519
524
|
label_len = [parent_label.length, child_label.length].max
|
520
|
-
parent_column_info_str = parent_column_info.inspect.slice(1...-1)
|
521
|
-
child_column_info_str = child_column_info.inspect.slice(1...-1)
|
522
525
|
|
523
526
|
@logger.warn(<<-EOS % [label_len, parent_label, label_len, child_label])
|
524
527
|
[WARNING] Relation column type is different.
|
525
|
-
%*s: #{
|
526
|
-
%*s: #{
|
528
|
+
%*s: #{parent_column_info}
|
529
|
+
%*s: #{child_column_info}
|
527
530
|
EOS
|
528
531
|
end
|
529
532
|
end
|
data/lib/ridgepole/version.rb
CHANGED
@@ -1,8 +1,9 @@
|
|
1
1
|
describe 'Ridgepole::Client#diff -> migrate' do
|
2
2
|
before { subject.diff(actual_dsl).migrate }
|
3
|
-
subject { client(:table_options => table_options, :dump_without_table_options =>
|
3
|
+
subject { client(:table_options => table_options, :dump_without_table_options => dump_without_table_options) }
|
4
4
|
|
5
5
|
let(:warning_regexp) { /table options differ/ }
|
6
|
+
let(:dump_without_table_options) { false }
|
6
7
|
|
7
8
|
let(:actual_dsl) {
|
8
9
|
erbh(<<-EOS)
|
@@ -37,4 +38,15 @@ describe 'Ridgepole::Client#diff -> migrate' do
|
|
37
38
|
expect(delta.differ?).to be_falsey
|
38
39
|
}
|
39
40
|
end
|
41
|
+
|
42
|
+
context 'when dump_without_table_options => true' do
|
43
|
+
let(:table_options) { 'ENGINE=InnoDB DEFAULT CHARSET=utf8mb4' }
|
44
|
+
let(:dump_without_table_options) { true }
|
45
|
+
|
46
|
+
it {
|
47
|
+
expect(Ridgepole::Logger.instance).to_not receive(:warn)
|
48
|
+
delta = subject.diff(expected_dsl)
|
49
|
+
expect(delta.differ?).to be_falsey
|
50
|
+
}
|
51
|
+
end
|
40
52
|
end
|
@@ -45,8 +45,8 @@ describe 'Ridgepole::Client#diff -> migrate', condition: 5.1 do
|
|
45
45
|
it {
|
46
46
|
expect(Ridgepole::Logger.instance).to receive(:warn).with(<<-EOS)
|
47
47
|
[WARNING] Relation column type is different.
|
48
|
-
employees.id: :type=>:bigint
|
49
|
-
dept_manager.employee_id: :type=>:integer
|
48
|
+
employees.id: {:type=>:bigint}
|
49
|
+
dept_manager.employee_id: {:type=>:integer}
|
50
50
|
EOS
|
51
51
|
|
52
52
|
delta = subject.diff(expected_dsl)
|
@@ -103,8 +103,8 @@ describe 'Ridgepole::Client#diff -> migrate', condition: 5.1 do
|
|
103
103
|
it {
|
104
104
|
expect(Ridgepole::Logger.instance).to receive(:warn).with(<<-EOS)
|
105
105
|
[WARNING] Relation column type is different.
|
106
|
-
employees.id: :type=>:bigint, :unsigned=>true
|
107
|
-
dept_manager.employee_id: :type=>:bigint
|
106
|
+
employees.id: {:type=>:bigint, :unsigned=>true}
|
107
|
+
dept_manager.employee_id: {:type=>:bigint}
|
108
108
|
EOS
|
109
109
|
|
110
110
|
delta = subject.diff(expected_dsl)
|
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.7.0.
|
4
|
+
version: 0.7.0.beta21
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Genki Sugawara
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-07-
|
11
|
+
date: 2017-07-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|