ridgepole 0.7.0.beta13 → 0.7.0.beta14
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 +4 -4
- data/README.md +4 -2
- data/bin/ridgepole +1 -0
- data/lib/ridgepole/diff.rb +5 -0
- data/lib/ridgepole/version.rb +1 -1
- data/spec/mysql/cli/ridgepole_spec.rb +1 -0
- data/spec/mysql/migrate/migrate_change_table_option_spec.rb +39 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0616cfe50a584d86fcdb940ffb823c88501f7c23
|
4
|
+
data.tar.gz: 6c5c72c83a83bede2d0af5f538b96217267765d7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8cfe029b261964757b99d47f4ee15c4ea7e5fe2baa25f8b4ee668f509d1c109201c7006cf7e4209432386a6e3b9e2fc34b7758bd3c2823d066ecfbdba509b2f0
|
7
|
+
data.tar.gz: 5ffbcd3b7749eec49e278b47baec072bae162200398dcf5b77a186bdde3870baac07c4a38ecd472fec95e33ea57e5cdb2c772d8557f9f5345ec978fc5d99e7e5
|
data/README.md
CHANGED
@@ -9,11 +9,11 @@ It defines DB schema using [Rails DSL](http://guides.rubyonrails.org/migrations.
|
|
9
9
|
[](https://travis-ci.org/winebarrel/ridgepole)
|
10
10
|
[](https://coveralls.io/github/winebarrel/ridgepole?branch=0.6)
|
11
11
|
|
12
|
-
[](https://rubygems.org/gems/ridgepole/versions/0.7.0.beta14)
|
13
13
|
[](https://travis-ci.org/winebarrel/ridgepole)
|
14
14
|
[](https://coveralls.io/github/winebarrel/ridgepole?branch=0.7)
|
15
15
|
|
16
|
-
**
|
16
|
+
**ChangeLog**
|
17
17
|
|
18
18
|
* `>= 0.4.8`
|
19
19
|
* `activerecord-mysql-unsigned` is now optional. Please pass `--enable-mysql-unsigned` after you install [activerecord-mysql-unsigned](https://github.com/waka/activerecord-mysql-unsigned) if you want to use.
|
@@ -78,6 +78,7 @@ It defines DB schema using [Rails DSL](http://guides.rubyonrails.org/migrations.
|
|
78
78
|
* Add `--check-relation-type` option
|
79
79
|
* Add `--skip-column-comment-change` option
|
80
80
|
* Add `--default-bigint-limit` option
|
81
|
+
* Add `--ignore-table-comment` option
|
81
82
|
|
82
83
|
## Installation
|
83
84
|
|
@@ -131,6 +132,7 @@ Usage: ridgepole [options]
|
|
131
132
|
--skip-drop-table
|
132
133
|
--mysql-change-table-options
|
133
134
|
--check-relation-type DEF_PK
|
135
|
+
--ignore-table-comment
|
134
136
|
--skip-column-comment-change
|
135
137
|
-r, --require LIBS
|
136
138
|
--log-file LOG_FILE
|
data/bin/ridgepole
CHANGED
@@ -123,6 +123,7 @@ ARGV.options do |opt|
|
|
123
123
|
opt.on('', '--skip-drop-table') { options[:skip_drop_table] = true }
|
124
124
|
opt.on('', '--mysql-change-table-options') { options[:mysql_change_table_options] = true }
|
125
125
|
opt.on('', '--check-relation-type DEF_PK') {|v| options[:check_relation_type] = v }
|
126
|
+
opt.on('', '--ignore-table-comment') { options[:ignore_table_comment] = true }
|
126
127
|
opt.on('', '--skip-column-comment-change') { options[:skip_column_comment_change] = true }
|
127
128
|
opt.on('-r', '--require LIBS', Array) {|v| v.each {|i| require i } }
|
128
129
|
opt.on('' , '--log-file LOG_FILE') {|v| options[:log_file] = v }
|
data/lib/ridgepole/diff.rb
CHANGED
@@ -110,6 +110,11 @@ class Ridgepole::Diff
|
|
110
110
|
from_options = from[:options] || {}
|
111
111
|
to_options = to[:options] || {}
|
112
112
|
|
113
|
+
if @options[:ignore_table_comment]
|
114
|
+
from.delete(:comment)
|
115
|
+
to.delete(:comment)
|
116
|
+
end
|
117
|
+
|
113
118
|
if @options[:mysql_change_table_options] and from_options != to_options and Ridgepole::ConnectionAdapters.mysql?
|
114
119
|
from.delete(:options)
|
115
120
|
to.delete(:options)
|
data/lib/ridgepole/version.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
describe 'Ridgepole::Client#diff -> migrate' do
|
2
|
-
context 'when
|
2
|
+
context 'when create_table options are different' do
|
3
3
|
let(:actual_dsl) {
|
4
4
|
erbh(<<-EOS)
|
5
5
|
create_table "employees", primary_key: "emp_no", force: :cascade do |t|
|
@@ -50,4 +50,42 @@ describe 'Ridgepole::Client#diff -> migrate' do
|
|
50
50
|
expect(delta.differ?).to be_falsey
|
51
51
|
}
|
52
52
|
end
|
53
|
+
|
54
|
+
context 'when create_table options are different (ignore comment)' do
|
55
|
+
let(:actual_dsl) {
|
56
|
+
erbh(<<-EOS)
|
57
|
+
create_table "employees", primary_key: "emp_no", force: :cascade do |t|
|
58
|
+
t.date "birth_date", null: false
|
59
|
+
t.string "first_name", limit: 14, null: false
|
60
|
+
t.string "last_name", limit: 16, null: false
|
61
|
+
t.string "gender", limit: 1, null: false
|
62
|
+
t.date "hire_date", null: false
|
63
|
+
end
|
64
|
+
EOS
|
65
|
+
}
|
66
|
+
|
67
|
+
let(:expected_dsl) {
|
68
|
+
erbh(<<-EOS)
|
69
|
+
create_table "employees", primary_key: "emp_no", comment: "my comment", force: :cascade do |t|
|
70
|
+
t.date "birth_date", null: false
|
71
|
+
t.string "first_name", limit: 14, null: false
|
72
|
+
t.string "last_name", limit: 16, null: false
|
73
|
+
t.string "gender", limit: 1, null: false
|
74
|
+
t.date "hire_date", null: false
|
75
|
+
end
|
76
|
+
EOS
|
77
|
+
}
|
78
|
+
|
79
|
+
before { subject.diff(actual_dsl).migrate }
|
80
|
+
subject { client(ignore_table_comment: true) }
|
81
|
+
|
82
|
+
it {
|
83
|
+
expect(Ridgepole::Logger.instance).to_not receive(:warn)
|
84
|
+
delta = subject.diff(expected_dsl)
|
85
|
+
expect(delta.differ?).to be_falsey
|
86
|
+
expect(subject.dump).to match_fuzzy actual_dsl
|
87
|
+
delta.migrate
|
88
|
+
expect(subject.dump).to match_fuzzy actual_dsl
|
89
|
+
}
|
90
|
+
end
|
53
91
|
end
|
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.beta14
|
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-
|
11
|
+
date: 2017-07-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|