ridgepole 0.4.3 → 0.4.4

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 03b066ad5d7807bd60303e0433ee67703aff903e
4
- data.tar.gz: fc2f852d90be9b0c24acf521d0fc5c62dea4f9c0
3
+ metadata.gz: c176eaae904de1588223d175a7ba36e49e04a2db
4
+ data.tar.gz: 2aeecdcaf4989e90ab383e8d8df9b0bfd13e98cc
5
5
  SHA512:
6
- metadata.gz: 72e7998e9e154814fae664cfa94be66b33750919729c810c126e3fea9659599f9cf68c13071661ca1d047a4e66030c14f829b77444f78ec06fd8ba4d4090b750
7
- data.tar.gz: 40f62f7da32cf5c8a22c53a71a1725e87728f571021e10286acb5f959f0f4a970a5a7133d82d7226f81e2196c4f7a2f73653fc88b74a7eabbb4df5246a40c59b
6
+ metadata.gz: c6f5adb0cae77d47f9ebea477a9219c87c58ca2dfd65774533ede9058a0aa86a6cd2032f67481f79c6b00746987108847682c416a3e615078d369ebae78fd841
7
+ data.tar.gz: bf5a941c4e33fea0010d7ea7caab81aa10f239d3658aa8fe55f11d5f1c27563a725a44f2b8e0db9fd74d1d6f6c439b755c54aba48acad4e87649ad5642a5d42f
data/README.md CHANGED
@@ -174,6 +174,7 @@ remove_column("articles", "author")
174
174
  ## Demo
175
175
 
176
176
  * [asciinema.org/a/9349](https://asciinema.org/a/9349)
177
+ * [asciinema.org/a/11788](https://asciinema.org/a/11788)
177
178
 
178
179
  ## Example project
179
180
 
@@ -80,6 +80,12 @@ ARGV.options do |opt|
80
80
  opt.on('' , '--log-file LOG_FILE') {|v| options[:log_file] = v }
81
81
  opt.on('' , '--verbose') { Ridgepole::Logger.verbose = true }
82
82
  opt.on('' , '--debug') { options[:debug] = true }
83
+
84
+ opt.on('-v', '--version') {
85
+ puts opt.ver
86
+ exit
87
+ }
88
+
83
89
  opt.parse!
84
90
 
85
91
  if not mode or ([:apply, :export].include?(mode) and not config) or (options[:with_apply] and not config)
@@ -1,3 +1,3 @@
1
1
  module Ridgepole
2
- VERSION = '0.4.3'
2
+ VERSION = '0.4.4'
3
3
  end
@@ -35,6 +35,58 @@ describe 'Ridgepole::Client#diff -> migrate' do
35
35
  }
36
36
  end
37
37
 
38
+ context 'when change index without using (change)' do
39
+ let(:actual_dsl) {
40
+ <<-RUBY
41
+ create_table "salaries", id: false, force: true do |t|
42
+ t.integer "emp_no", null: false
43
+ t.integer "salary", null: false
44
+ t.date "from_date", null: false
45
+ t.date "to_date", null: false
46
+ end
47
+
48
+ add_index "salaries", ["emp_no"], name: "emp_no", using: :btree
49
+ RUBY
50
+ }
51
+
52
+ let(:dsl) {
53
+ <<-RUBY
54
+ create_table "salaries", id: false, force: true do |t|
55
+ t.integer "emp_no", null: false
56
+ t.integer "salary", null: false
57
+ t.date "from_date", null: false
58
+ t.date "to_date", null: false
59
+ end
60
+
61
+ add_index "salaries", ["salary"], using: :hash
62
+ RUBY
63
+ }
64
+
65
+ let(:expected_dsl) {
66
+ <<-RUBY
67
+ create_table "salaries", id: false, force: true do |t|
68
+ t.integer "emp_no", null: false
69
+ t.integer "salary", null: false
70
+ t.date "from_date", null: false
71
+ t.date "to_date", null: false
72
+ end
73
+
74
+ add_index "salaries", ["salary"], name: "index_salaries_on_salary", using: :hash
75
+ RUBY
76
+ }
77
+
78
+ before { subject.diff(actual_dsl).migrate }
79
+ subject { client(:table_options => 'ENGINE=MEMORY') }
80
+
81
+ it {
82
+ delta = subject.diff(dsl)
83
+ expect(delta.differ?).to be_truthy
84
+ expect(subject.dump.delete_empty_lines).to eq actual_dsl.strip_heredoc.strip.delete_empty_lines
85
+ delta.migrate
86
+ expect(subject.dump.delete_empty_lines).to eq expected_dsl.strip_heredoc.strip.delete_empty_lines
87
+ }
88
+ end
89
+
38
90
  context 'when change index without name (no change)' do
39
91
  let(:actual_dsl) {
40
92
  <<-RUBY
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.4.3
4
+ version: 0.4.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Genki Sugawara