ridgepole 0.7.0.beta13 → 0.7.0.beta14

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: f26a101fb8d0e30d98ed68ea44d6d10c9e1b4890
4
- data.tar.gz: 765b92df8b2d0fb304f062cfdf4b2eb3eb230e0b
3
+ metadata.gz: 0616cfe50a584d86fcdb940ffb823c88501f7c23
4
+ data.tar.gz: 6c5c72c83a83bede2d0af5f538b96217267765d7
5
5
  SHA512:
6
- metadata.gz: 537d7f1e01baff056b431cfa6d4f55db876e4564ae76a5da3ba2224f567c04bdacb5c0181270e7f1bba67298957506f980cab9813f88ee4c60c9b1a0102aa9bd
7
- data.tar.gz: a74a3b777e4ccc6e25f9978895150beccd140585553d3dd53590ddc3b5944ce966032bf00e5f83f4137693d87c1955b2b0a8cc6befb9d1cb29d3a3c76ffd55f1
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
  [![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.beta13-brightgreen.svg)](https://rubygems.org/gems/ridgepole/versions/0.7.0.beta13)
12
+ [![Edge Version](https://img.shields.io/badge/edge_version-0.7.0.beta14-brightgreen.svg)](https://rubygems.org/gems/ridgepole/versions/0.7.0.beta14)
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
 
16
- **Notice**
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 }
@@ -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)
@@ -1,3 +1,3 @@
1
1
  module Ridgepole
2
- VERSION = '0.7.0.beta13'
2
+ VERSION = '0.7.0.beta14'
3
3
  end
@@ -48,6 +48,7 @@ describe 'ridgepole' do
48
48
  --skip-drop-table
49
49
  --mysql-change-table-options
50
50
  --check-relation-type DEF_PK
51
+ --ignore-table-comment
51
52
  --skip-column-comment-change
52
53
  -r, --require LIBS
53
54
  --log-file LOG_FILE
@@ -1,5 +1,5 @@
1
1
  describe 'Ridgepole::Client#diff -> migrate' do
2
- context 'when change column' do
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.beta13
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-06-30 00:00:00.000000000 Z
11
+ date: 2017-07-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord