ridgepole 0.7.0.beta9 → 0.7.0.beta10

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: 5fad6f6046bff06fbe559b4da0f9bf1f302a5d8d
4
- data.tar.gz: d74561e4b51b708c04346a2d7cf23fb81b16506c
3
+ metadata.gz: 43d1094d18230aec0edeb8cfc3ba63783b074e54
4
+ data.tar.gz: 3dcc6e2ead2ecd1eae6f5abd09865f272ee0ac6c
5
5
  SHA512:
6
- metadata.gz: ee4042bf17a7f05d6fe062fa57925578e5a22a5cd7a169ddae4048ef328aff2696a90beb1b4ec8e58ea3d74b170aae4ba26d549d81e39143d7fc5b22631fb215
7
- data.tar.gz: c7af7cb79c2cd5a4659de44f8b8f5a819e89b8ed7d3175eef6ff5ab417532012469b9d743059082e28f099585903602a148c953558c97f38f12d3a53939148b1
6
+ metadata.gz: '08568bf10b61386b12462595b19c6a9ee527423f7a72224978a202dd6f5a6b0c953d69669c5f3821318b72834b669f2165fa84b081657434af4ccb63224a7958'
7
+ data.tar.gz: fdd40f8896581ddfb80e1f5921329c8a3bdc6eb202c60cf345e1df72eb2c842b1ae3c071d111ec3e8dc003c5d16ce723e15c99e48b18acae028818f72f390310
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.beta9-brightgreen.svg)](https://rubygems.org/gems/ridgepole/versions/0.7.0.beta9)
12
+ [![Edge Version](https://img.shields.io/badge/edge_version-0.7.0.beta10-brightgreen.svg)](https://rubygems.org/gems/ridgepole/versions/0.7.0.beta10)
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
 
@@ -76,6 +76,7 @@ It defines DB schema using [Rails DSL](http://guides.rubyonrails.org/migrations.
76
76
  * Pass config from env
77
77
  * Fix change fk order
78
78
  * Add `--check-relation-type` option
79
+ * Add `--skip-column-comment-change` option
79
80
 
80
81
  ## Installation
81
82
 
@@ -128,6 +129,7 @@ Usage: ridgepole [options]
128
129
  --skip-drop-table
129
130
  --mysql-change-table-options
130
131
  --check-relation-type DEF_PK
132
+ --skip-column-comment-change
131
133
  -r, --require LIBS
132
134
  --log-file LOG_FILE
133
135
  --verbose
data/bin/ridgepole CHANGED
@@ -122,6 +122,7 @@ ARGV.options do |opt|
122
122
  opt.on('', '--skip-drop-table') { options[:skip_drop_table] = true }
123
123
  opt.on('', '--mysql-change-table-options') { options[:mysql_change_table_options] = true }
124
124
  opt.on('', '--check-relation-type DEF_PK') {|v| options[:check_relation_type] = v }
125
+ opt.on('', '--skip-column-comment-change') { options[:skip_column_comment_change] = true }
125
126
  opt.on('-r', '--require LIBS', Array) {|v| v.each {|i| require i } }
126
127
  opt.on('' , '--log-file LOG_FILE') {|v| options[:log_file] = v }
127
128
  opt.on('' , '--verbose') { Ridgepole::Logger.verbose = true }
@@ -402,6 +402,12 @@ class Ridgepole::Diff
402
402
  attrs1 = attrs1.merge(:options => attrs1.fetch(:options, {}).dup)
403
403
  attrs2 = attrs2.merge(:options => attrs2.fetch(:options, {}).dup)
404
404
  normalize_default_proc_options!(attrs1[:options], attrs2[:options])
405
+
406
+ if @options[:skip_column_comment_change]
407
+ attrs1.fetch(:options).delete(:comment)
408
+ attrs2.fetch(:options).delete(:comment)
409
+ end
410
+
405
411
  attrs1 == attrs2
406
412
  end
407
413
 
@@ -1,3 +1,3 @@
1
1
  module Ridgepole
2
- VERSION = '0.7.0.beta9'
2
+ VERSION = '0.7.0.beta10'
3
3
  end
@@ -47,6 +47,7 @@ describe 'ridgepole' do
47
47
  --skip-drop-table
48
48
  --mysql-change-table-options
49
49
  --check-relation-type DEF_PK
50
+ --skip-column-comment-change
50
51
  -r, --require LIBS
51
52
  --log-file LOG_FILE
52
53
  --verbose
@@ -0,0 +1,38 @@
1
+ describe 'Ridgepole::Client#diff -> migrate' do
2
+ context 'when change column ignore comment' do
3
+ let(:actual_dsl) {
4
+ erbh(<<-EOS)
5
+ create_table "employees", primary_key: "emp_no", force: :cascade do |t|
6
+ t.date "birth_date", null: false, comment: "my comment"
7
+ t.string "first_name", limit: 14, null: false
8
+ t.string "last_name", limit: 16, null: false
9
+ t.string "gender", limit: 1, null: false
10
+ t.date "hire_date", null: false
11
+ t.index ["gender"], name: "gender", <%= i cond(5.0, using: :btree) %>
12
+ end
13
+ EOS
14
+ }
15
+
16
+ let(:expected_dsl) {
17
+ erbh(<<-EOS)
18
+ create_table :employees, primary_key: :emp_no, force: :cascade do |t|
19
+ t.date "birth_date", null: false
20
+ t.string "first_name", limit: 14, null: false, comment: "my comment2"
21
+ t.string "last_name", limit: 16, null: false
22
+ t.string "gender", limit: 1, null: false
23
+ t.date :hire_date, null: false
24
+ t.index :gender, name: :gender, <%= i cond(5.0, using: :btree) %>
25
+ end
26
+ EOS
27
+ }
28
+
29
+ before { subject.diff(actual_dsl).migrate }
30
+ subject { client(skip_column_comment_change: true) }
31
+
32
+ it {
33
+ delta = subject.diff(expected_dsl)
34
+ puts delta.script
35
+ expect(delta.differ?).to be_falsey
36
+ }
37
+ end
38
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ridgepole
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.0.beta9
4
+ version: 0.7.0.beta10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Genki Sugawara
@@ -307,6 +307,7 @@ files:
307
307
  - spec/mysql/migrate/migrate_same_default_null_spec.rb
308
308
  - spec/mysql/migrate/migrate_same_spec.rb
309
309
  - spec/mysql/migrate/migrate_script_error_spec.rb
310
+ - spec/mysql/migrate/migrate_skip_column_comment_change_spec.rb
310
311
  - spec/mysql/migrate/migrate_skip_drop_table_spec.rb
311
312
  - spec/mysql/migrate/migrate_skip_rename_column_spec.rb
312
313
  - spec/mysql/migrate/migrate_skip_rename_table_spec.rb
@@ -450,6 +451,7 @@ test_files:
450
451
  - spec/mysql/migrate/migrate_same_default_null_spec.rb
451
452
  - spec/mysql/migrate/migrate_same_spec.rb
452
453
  - spec/mysql/migrate/migrate_script_error_spec.rb
454
+ - spec/mysql/migrate/migrate_skip_column_comment_change_spec.rb
453
455
  - spec/mysql/migrate/migrate_skip_drop_table_spec.rb
454
456
  - spec/mysql/migrate/migrate_skip_rename_column_spec.rb
455
457
  - spec/mysql/migrate/migrate_skip_rename_table_spec.rb