ridgepole 0.8.7 → 0.8.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +34 -0
- data/.travis.yml +1 -0
- data/README.md +3 -1
- data/lib/ridgepole/delta.rb +28 -21
- data/lib/ridgepole/dsl_parser/context.rb +1 -2
- data/lib/ridgepole/external_sql_executer.rb +1 -1
- data/lib/ridgepole/version.rb +1 -1
- data/spec/mysql/collation/collation_spec.rb +6 -0
- data/spec/mysql/diff/diff2_spec.rb +3 -3
- data/spec/mysql/diff/diff_spec.rb +3 -3
- data/spec/mysql/fk/migrate_create_fk_spec.rb +2 -2
- data/spec/mysql/fk/migrate_drop_fk_spec.rb +1 -1
- data/spec/mysql/fk/migrate_fk_with_column_spec.rb +2 -2
- data/spec/mysql/migrate/migrate_add_column_spec.rb +5 -5
- data/spec/mysql/migrate/migrate_change_column_spec.rb +5 -5
- data/spec/mysql/migrate/migrate_change_index_spec.rb +9 -9
- data/spec/mysql/migrate/migrate_create_index_spec.rb +6 -6
- data/spec/mysql/migrate/migrate_create_table_with_index_spec.rb +7 -7
- data/spec/mysql/migrate/migrate_create_table_with_options_spec.rb +8 -8
- data/spec/mysql/migrate/migrate_drop_column_and_index_spec.rb +4 -4
- data/spec/mysql/migrate/migrate_drop_column_spec.rb +3 -3
- data/spec/mysql/migrate/migrate_drop_index_spec.rb +6 -6
- data/spec/mysql/migrate/migrate_rename_column_spec.rb +3 -3
- data/spec/mysql/migrate/migrate_script_error_spec.rb +1 -1
- data/spec/mysql/~default_name_fk/migrate_create_fk_spec.rb +1 -1
- data/spec/mysql/~default_name_fk/migrate_drop_fk_spec.rb +1 -1
- data/spec/mysql/~dump_auto_increment/migrate_create_table_with_index_spec.rb +7 -7
- data/spec/postgresql/diff/diff_spec.rb +2 -2
- data/spec/postgresql/fk/migrate_create_fk_spec.rb +2 -2
- data/spec/postgresql/fk/migrate_drop_fk_spec.rb +1 -1
- data/spec/postgresql/migrate/migrate_add_column_spec.rb +5 -5
- data/spec/postgresql/migrate/migrate_change_column_spec.rb +4 -4
- data/spec/postgresql/migrate/migrate_change_index_spec.rb +9 -9
- data/spec/postgresql/migrate/migrate_drop_column_spec.rb +3 -3
- data/spec/postgresql/migrate/migrate_drop_column_with_index_spec.rb +5 -5
- data/spec/postgresql/migrate/migrate_drop_expression_index_spec.rb +1 -1
- data/spec/postgresql/migrate/migrate_drop_index_spec.rb +6 -6
- data/spec/postgresql/migrate/migrate_rename_column_spec.rb +2 -2
- data/spec/postgresql/~default_name_fk/migrate_create_fk_spec.rb +1 -1
- data/spec/postgresql/~default_name_fk/migrate_drop_fk_spec.rb +1 -1
- data/spec/spec_condition.rb +0 -4
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9c506e7bf27fec2d935daf79fae7e9b653dd3b65114633e401b8683755e9ca7a
|
4
|
+
data.tar.gz: a4615e7fe4fa35628471d512fc70fd969774ef1c8270e0ad161eb58772207dac
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 67459d1042f159bbe4345335d12029470cfb272cf75bba8ebfa7b2de05234e3fd0adba87c303817f927567654676db93efc0e8563ec9e47745b6f3c906c4d241
|
7
|
+
data.tar.gz: 4713c918e439078a179a185c148606d14e4c526261b4094d1417277cd471b30cdf2b3b4f0c7bca66c7e73637f1125ce3296b9cac4d55f38873d9b16d3527fd65
|
data/.rubocop.yml
CHANGED
@@ -41,3 +41,37 @@ Layout/ClosingHeredocIndentation:
|
|
41
41
|
Enabled: false
|
42
42
|
Style/NumericPredicate:
|
43
43
|
Enabled: false
|
44
|
+
Layout/EmptyLinesAroundAttributeAccessor:
|
45
|
+
Enabled: true
|
46
|
+
Layout/SpaceAroundMethodCallOperator:
|
47
|
+
Enabled: true
|
48
|
+
Lint/DeprecatedOpenSSLConstant:
|
49
|
+
Enabled: true
|
50
|
+
Lint/MixedRegexpCaptureTypes:
|
51
|
+
Enabled: true
|
52
|
+
Lint/RaiseException:
|
53
|
+
Enabled: true
|
54
|
+
Lint/StructNewOverride:
|
55
|
+
Enabled: true
|
56
|
+
Style/AccessorGrouping:
|
57
|
+
Enabled: true
|
58
|
+
Style/BisectedAttrAccessor:
|
59
|
+
Enabled: true
|
60
|
+
Style/ExponentialNotation:
|
61
|
+
Enabled: true
|
62
|
+
Style/HashEachMethods:
|
63
|
+
Enabled: true
|
64
|
+
Style/HashTransformKeys:
|
65
|
+
Enabled: true
|
66
|
+
Style/HashTransformValues:
|
67
|
+
Enabled: true
|
68
|
+
Style/RedundantAssignment:
|
69
|
+
Enabled: true
|
70
|
+
Style/RedundantFetchBlock:
|
71
|
+
Enabled: true
|
72
|
+
Style/RedundantRegexpCharacterClass:
|
73
|
+
Enabled: true
|
74
|
+
Style/RedundantRegexpEscape:
|
75
|
+
Enabled: true
|
76
|
+
Style/SlicingWithRange:
|
77
|
+
Enabled: true
|
data/.travis.yml
CHANGED
data/README.md
CHANGED
@@ -115,6 +115,8 @@ It defines DB schema using [Rails DSL](http://guides.rubyonrails.org/migrations.
|
|
115
115
|
* Support multiple databases feature ([pull#297](https://github.com/winebarrel/ridgepole/pull/297))
|
116
116
|
* `>= 0.8.7`
|
117
117
|
* Support `require_relative` ([pull#298](https://github.com/winebarrel/ridgepole/pull/298))
|
118
|
+
* `>= 0.8.8`
|
119
|
+
* Fix keyword arguments warnings in Ruby 2.7 ([pull#303](https://github.com/winebarrel/ridgepole/pull/303))
|
118
120
|
</details>
|
119
121
|
|
120
122
|
## Installation
|
@@ -193,6 +195,7 @@ Usage: ridgepole [options]
|
|
193
195
|
--ignore-table-comment
|
194
196
|
--skip-column-comment-change
|
195
197
|
--create-table-with-index
|
198
|
+
--allow-pk-change
|
196
199
|
--mysql-dump-auto-increment
|
197
200
|
-r, --require LIBS
|
198
201
|
--log-file LOG_FILE
|
@@ -309,7 +312,6 @@ end
|
|
309
312
|
```
|
310
313
|
|
311
314
|
## Collation/Charset
|
312
|
-
You can use the column collation by passing `--enable-mysql-awesome` ([activerecord-mysql-awesome](https://github.com/kamipo/activerecord-mysql-awesome) is required)
|
313
315
|
|
314
316
|
```ruby
|
315
317
|
create_table "articles", force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8" do |t|
|
data/lib/ridgepole/delta.rb
CHANGED
@@ -326,7 +326,7 @@ execute "ALTER TABLE #{ActiveRecord::Base.connection.quote_table_name(table_name
|
|
326
326
|
end
|
327
327
|
|
328
328
|
def append_change_table(table_name, buf)
|
329
|
-
buf.puts "change_table(#{table_name.inspect},
|
329
|
+
buf.puts "change_table(#{table_name.inspect}, bulk: true) do |t|" if @options[:bulk_change]
|
330
330
|
yield
|
331
331
|
buf.puts 'end' if @options[:bulk_change]
|
332
332
|
end
|
@@ -429,11 +429,11 @@ remove_column(#{table_name.inspect}, #{column_name.inspect})
|
|
429
429
|
|
430
430
|
if force_bulk_change || @options[:bulk_change]
|
431
431
|
buf.puts(<<-RUBY)
|
432
|
-
t.index(#{column_name.inspect},
|
432
|
+
t.index(#{column_name.inspect}, **#{options.inspect})
|
433
433
|
RUBY
|
434
434
|
else
|
435
435
|
buf.puts(<<-RUBY)
|
436
|
-
add_index(#{table_name.inspect}, #{column_name.inspect},
|
436
|
+
add_index(#{table_name.inspect}, #{column_name.inspect}, **#{options.inspect})
|
437
437
|
RUBY
|
438
438
|
end
|
439
439
|
end
|
@@ -441,15 +441,20 @@ add_index(#{table_name.inspect}, #{column_name.inspect}, #{options.inspect})
|
|
441
441
|
def append_remove_index(table_name, _index_name, attrs, buf)
|
442
442
|
column_name = attrs.fetch(:column_name)
|
443
443
|
options = attrs[:options] || {}
|
444
|
-
target =
|
444
|
+
target =
|
445
|
+
if options[:name]
|
446
|
+
"name: #{options[:name].inspect}"
|
447
|
+
else
|
448
|
+
column_name.inspect
|
449
|
+
end
|
445
450
|
|
446
451
|
if @options[:bulk_change]
|
447
452
|
buf.puts(<<-RUBY)
|
448
|
-
t.remove_index(#{target
|
453
|
+
t.remove_index(#{target})
|
449
454
|
RUBY
|
450
455
|
else
|
451
456
|
buf.puts(<<-RUBY)
|
452
|
-
remove_index(#{table_name.inspect}, #{target
|
457
|
+
remove_index(#{table_name.inspect}, #{target})
|
453
458
|
RUBY
|
454
459
|
end
|
455
460
|
end
|
@@ -469,7 +474,7 @@ remove_index(#{table_name.inspect}, #{target.inspect})
|
|
469
474
|
attrs_options = attrs[:options] || {}
|
470
475
|
|
471
476
|
buf.puts(<<-RUBY)
|
472
|
-
add_foreign_key(#{table_name.inspect}, #{to_table.inspect},
|
477
|
+
add_foreign_key(#{table_name.inspect}, #{to_table.inspect}, **#{attrs_options.inspect})
|
473
478
|
RUBY
|
474
479
|
end
|
475
480
|
|
@@ -478,13 +483,13 @@ add_foreign_key(#{table_name.inspect}, #{to_table.inspect}, #{attrs_options.insp
|
|
478
483
|
fk_name = attrs_options[:name]
|
479
484
|
|
480
485
|
target = if fk_name
|
481
|
-
|
486
|
+
"name: #{fk_name.inspect}"
|
482
487
|
else
|
483
|
-
attrs.fetch(:to_table)
|
488
|
+
attrs.fetch(:to_table).inspect
|
484
489
|
end
|
485
490
|
|
486
491
|
buf.puts(<<-RUBY)
|
487
|
-
remove_foreign_key(#{table_name.inspect}, #{target
|
492
|
+
remove_foreign_key(#{table_name.inspect}, #{target})
|
488
493
|
RUBY
|
489
494
|
end
|
490
495
|
|
@@ -500,17 +505,19 @@ remove_foreign_key(#{table_name.inspect}, #{target.inspect})
|
|
500
505
|
def inspect_options_include_default_proc(options)
|
501
506
|
options = options.dup
|
502
507
|
|
503
|
-
|
504
|
-
|
505
|
-
|
506
|
-
|
507
|
-
|
508
|
-
|
509
|
-
|
510
|
-
|
511
|
-
|
512
|
-
|
513
|
-
|
508
|
+
kwargs =
|
509
|
+
if options[:default].is_a?(Proc)
|
510
|
+
proc_default = options.delete(:default)
|
511
|
+
proc_default = ":default=>proc{#{proc_default.call.inspect}}"
|
512
|
+
options_inspect = options.inspect
|
513
|
+
options_inspect.sub!(/\}\z/, '')
|
514
|
+
options_inspect << ', ' if options_inspect !~ /\{\z/
|
515
|
+
options_inspect << proc_default << '}'
|
516
|
+
options_inspect
|
517
|
+
else
|
518
|
+
options.inspect
|
519
|
+
end
|
520
|
+
"**#{kwargs}"
|
514
521
|
end
|
515
522
|
end
|
516
523
|
end
|
data/lib/ridgepole/version.rb
CHANGED
@@ -138,6 +138,12 @@ describe 'Ridgepole::Client#diff -> migrate' do
|
|
138
138
|
opts = ['--dump-without-table-options']
|
139
139
|
out, status = run_ridgepole('--diff', "'#{JSON.dump(conn_spec)}'", f.path, *opts)
|
140
140
|
|
141
|
+
# v6.0.3 is the oldest version that doesn't produce any kwargs warnings with Ruby 2.7
|
142
|
+
if condition('< 6.0.3')
|
143
|
+
# https://github.com/jeremyevans/ruby-warning/blob/1.1.0/lib/warning.rb#L18
|
144
|
+
out = out.lines.grep_v(/: warning: (?:Using the last argument (?:for `.+' )?as keyword parameters is deprecated; maybe \*\* should be added to the call|Passing the keyword argument (?:for `.+' )?as the last hash parameter is deprecated|Splitting the last argument (?:for `.+' )?into positional and keyword parameters is deprecated|The called method (?:`.+' )?is defined here)\n\z/).join('')
|
145
|
+
end
|
146
|
+
|
141
147
|
expect(out).to be_empty
|
142
148
|
expect(status.success?).to be_truthy
|
143
149
|
end
|
@@ -175,10 +175,10 @@ describe 'Ridgepole::Client.diff' do
|
|
175
175
|
delta = subject.diff(actual_dsl, expected_dsl)
|
176
176
|
expect(delta.differ?).to be_truthy
|
177
177
|
expect(delta.script).to match_ruby erbh(<<-ERB)
|
178
|
-
change_column("employee_clubs", "club_id", :integer,
|
178
|
+
change_column("employee_clubs", "club_id", :integer, **<%= {:unsigned=>false, :null=>true, :default=>nil} + cond('>= 5.1', comment: nil) %>)
|
179
179
|
|
180
|
-
change_column("employees", "last_name", :string,
|
181
|
-
change_column("employees", "gender", :string,
|
180
|
+
change_column("employees", "last_name", :string, **<%= {:limit=>20, :default=>"XXX", :unsigned=>false} + cond('>= 5.1', comment: nil) %>)
|
181
|
+
change_column("employees", "gender", :string, **<%= {:limit=>2, :null=>false, :default=>nil, :unsigned=>false} + cond('>= 5.1', comment: nil) %>)
|
182
182
|
ERB
|
183
183
|
}
|
184
184
|
|
@@ -149,10 +149,10 @@ describe 'Ridgepole::Client.diff' do
|
|
149
149
|
delta = subject.diff(actual_dsl, expected_dsl)
|
150
150
|
expect(delta.differ?).to be_truthy
|
151
151
|
expect(delta.script).to match_ruby erbh(<<-ERB)
|
152
|
-
change_column("employee_clubs", "club_id", :integer,
|
152
|
+
change_column("employee_clubs", "club_id", :integer, **<%= {:unsigned=>false, :null=>true, :default=>nil} + cond('>= 5.1', comment: nil) %>)
|
153
153
|
|
154
|
-
change_column("employees", "last_name", :string,
|
155
|
-
change_column("employees", "gender", :string,
|
154
|
+
change_column("employees", "last_name", :string, **<%= {:limit=>20, :default=>"XXX", :unsigned=>false} + cond('>= 5.1', comment: nil) %>)
|
155
|
+
change_column("employees", "gender", :string, **<%= {:limit=>2, :null=>false, :default=>nil, :unsigned=>false} + cond('>= 5.1', comment: nil) %>)
|
156
156
|
ERB
|
157
157
|
}
|
158
158
|
end
|
@@ -36,7 +36,7 @@ describe 'Ridgepole::Client#diff -> migrate' do
|
|
36
36
|
expect(delta.differ?).to be_truthy
|
37
37
|
expect(subject.dump).to match_ruby actual_dsl
|
38
38
|
expect(delta.script).to match_fuzzy <<-RUBY
|
39
|
-
add_foreign_key("child", "parent", {:name=>"child_ibfk_1"})
|
39
|
+
add_foreign_key("child", "parent", **{:name=>"child_ibfk_1"})
|
40
40
|
RUBY
|
41
41
|
delta.migrate
|
42
42
|
expect(subject.dump).to match_ruby expected_dsl
|
@@ -144,7 +144,7 @@ describe 'Ridgepole::Client#diff -> migrate' do
|
|
144
144
|
expect(delta.differ?).to be_truthy
|
145
145
|
expect(subject.dump).to match_ruby actual_dsl
|
146
146
|
expect(delta.script).to match_fuzzy <<-RUBY
|
147
|
-
add_foreign_key("child", "parent", {})
|
147
|
+
add_foreign_key("child", "parent", **{})
|
148
148
|
RUBY
|
149
149
|
delta.migrate
|
150
150
|
expect(subject.dump).to match_ruby expected_dsl
|
@@ -50,7 +50,7 @@ describe 'Ridgepole::Client#diff -> migrate' do
|
|
50
50
|
expect(delta.differ?).to be_truthy
|
51
51
|
expect(subject.dump).to match_fuzzy sorted_actual_dsl
|
52
52
|
expect(delta.script).to match_fuzzy <<-RUBY
|
53
|
-
remove_foreign_key("child",
|
53
|
+
remove_foreign_key("child", name: "child_ibfk_1")
|
54
54
|
RUBY
|
55
55
|
delta.migrate
|
56
56
|
expect(subject.dump).to match_ruby expected_dsl
|
@@ -44,8 +44,8 @@ describe 'Ridgepole::Client#diff -> migrate' do
|
|
44
44
|
expect(delta.differ?).to be_truthy
|
45
45
|
expect(subject.dump).to match_ruby actual_dsl
|
46
46
|
expect(delta.script).to match_fuzzy <<-RUBY
|
47
|
-
add_foreign_key("direct_messages", "users", {:column=>"reciever_id"})
|
48
|
-
add_foreign_key("direct_messages", "users", {:column=>"sender_id"})
|
47
|
+
add_foreign_key("direct_messages", "users", **{:column=>"reciever_id"})
|
48
|
+
add_foreign_key("direct_messages", "users", **{:column=>"sender_id"})
|
49
49
|
RUBY
|
50
50
|
delta.migrate
|
51
51
|
expect(subject.dump).to match_ruby expected_dsl
|
@@ -145,13 +145,13 @@ describe 'Ridgepole::Client#diff -> migrate' do
|
|
145
145
|
expect(delta.differ?).to be_truthy
|
146
146
|
expect(subject.dump).to match_ruby actual_dsl
|
147
147
|
expect(delta.script).to match_fuzzy erbh(<<-ERB)
|
148
|
-
change_table("employee_clubs",
|
149
|
-
t.column("any_col", :string, {:null=>false, :after=>"club_id", :limit=>255})
|
148
|
+
change_table("employee_clubs", bulk: true) do |t|
|
149
|
+
t.column("any_col", :string, **{:null=>false, :after=>"club_id", :limit=>255})
|
150
150
|
end
|
151
151
|
|
152
|
-
change_table("employees",
|
153
|
-
t.column("age", :integer, {:null=>false, :after=>"hire_date", :limit=>4})
|
154
|
-
t.column("updated_at", :date, {:after=>"age"})
|
152
|
+
change_table("employees", bulk: true) do |t|
|
153
|
+
t.column("age", :integer, **{:null=>false, :after=>"hire_date", :limit=>4})
|
154
|
+
t.column("updated_at", :date, **{:after=>"age"})
|
155
155
|
end
|
156
156
|
ERB
|
157
157
|
delta.migrate
|
@@ -142,13 +142,13 @@ describe 'Ridgepole::Client#diff -> migrate' do
|
|
142
142
|
expect(delta.differ?).to be_truthy
|
143
143
|
expect(subject.dump).to match_ruby actual_dsl
|
144
144
|
expect(delta.script).to match_fuzzy erbh(<<-ERB)
|
145
|
-
change_table("employee_clubs",
|
146
|
-
t.change("club_id", :integer,
|
145
|
+
change_table("employee_clubs", bulk: true) do |t|
|
146
|
+
t.change("club_id", :integer, **<%= {:null=>true, :default=>nil, :unsigned=>false} + cond('>= 5.1',comment: nil) %>)
|
147
147
|
end
|
148
148
|
|
149
|
-
change_table("employees",
|
150
|
-
t.change("last_name", :string,
|
151
|
-
t.change("gender", :string,
|
149
|
+
change_table("employees", bulk: true) do |t|
|
150
|
+
t.change("last_name", :string, **<%= {:limit=>20, :default=>"XXX", :unsigned=>false} + cond('>= 5.1',comment: nil) %>)
|
151
|
+
t.change("gender", :string, **<%= {:limit=>2, :null=>false, :default=>nil, :unsigned=>false} + cond('>= 5.1',comment: nil) %>)
|
152
152
|
end
|
153
153
|
ERB
|
154
154
|
delta.migrate
|
@@ -204,19 +204,19 @@ describe 'Ridgepole::Client#diff -> migrate' do
|
|
204
204
|
expect(delta.differ?).to be_truthy
|
205
205
|
expect(subject.dump).to match_ruby actual_dsl
|
206
206
|
expect(delta.script).to match_fuzzy <<-RUBY
|
207
|
-
change_table("dept_emp",
|
208
|
-
t.remove_index(
|
209
|
-
t.index(["from_date"], {:name=>"emp_no", :using=>:btree, :unique=>false})
|
207
|
+
change_table("dept_emp", bulk: true) do |t|
|
208
|
+
t.remove_index(name: "emp_no")
|
209
|
+
t.index(["from_date"], **{:name=>"emp_no", :using=>:btree, :unique=>false})
|
210
210
|
end
|
211
211
|
|
212
|
-
change_table("dept_manager",
|
213
|
-
t.remove_index(
|
214
|
-
t.index(["from_date"], {:name=>"emp_no", :using=>:btree, :unique=>false})
|
212
|
+
change_table("dept_manager", bulk: true) do |t|
|
213
|
+
t.remove_index(name: "emp_no")
|
214
|
+
t.index(["from_date"], **{:name=>"emp_no", :using=>:btree, :unique=>false})
|
215
215
|
end
|
216
216
|
|
217
|
-
change_table("salaries",
|
218
|
-
t.remove_index(
|
219
|
-
t.index(["from_date"], {:name=>"emp_no", :using=>:btree, :unique=>false})
|
217
|
+
change_table("salaries", bulk: true) do |t|
|
218
|
+
t.remove_index(name: "emp_no")
|
219
|
+
t.index(["from_date"], **{:name=>"emp_no", :using=>:btree, :unique=>false})
|
220
220
|
end
|
221
221
|
RUBY
|
222
222
|
|
@@ -141,16 +141,16 @@ describe 'Ridgepole::Client#diff -> migrate' do
|
|
141
141
|
expect(delta.differ?).to be_truthy
|
142
142
|
expect(subject.dump).to match_ruby actual_dsl
|
143
143
|
expect(delta.script).to match_fuzzy erbh(<<-ERB)
|
144
|
-
change_table("clubs",
|
145
|
-
t.index(["name"],
|
144
|
+
change_table("clubs", bulk: true) do |t|
|
145
|
+
t.index(["name"], **<%= {:name=>"idx_name", :unique=>true} + cond(5.0, using: :btree) %>)
|
146
146
|
end
|
147
147
|
|
148
|
-
change_table("employee_clubs",
|
149
|
-
t.index(["emp_no", "club_id"],
|
148
|
+
change_table("employee_clubs", bulk: true) do |t|
|
149
|
+
t.index(["emp_no", "club_id"], **<%= {:name=>"idx_emp_no_club_id"} + cond(5.0, using: :btree) %>)
|
150
150
|
end
|
151
151
|
|
152
|
-
change_table("titles",
|
153
|
-
t.index(["emp_no"],
|
152
|
+
change_table("titles", bulk: true) do |t|
|
153
|
+
t.index(["emp_no"], **<%= {:name=>"emp_no"} + cond(5.0, using: :btree) %>)
|
154
154
|
end
|
155
155
|
ERB
|
156
156
|
delta.migrate
|
@@ -25,13 +25,13 @@ describe 'Ridgepole::Client#diff -> migrate (with index)' do
|
|
25
25
|
expect(delta.differ?).to be_truthy
|
26
26
|
|
27
27
|
expect(delta.script).to match_fuzzy erbh(<<-ERB)
|
28
|
-
create_table("dept_emp", {:primary_key=>["emp_no", "dept_no"]}) do |t|
|
29
|
-
t.column("emp_no", :"integer", {:null=>false, :limit=>4})
|
30
|
-
t.column("dept_no", :"string", {:null=>false, :limit=>255})
|
31
|
-
t.column("from_date", :"date", {:null=>false})
|
32
|
-
t.column("to_date", :"date", {:null=>false})
|
33
|
-
t.index(["dept_no"],
|
34
|
-
t.index(["emp_no"],
|
28
|
+
create_table("dept_emp", **{:primary_key=>["emp_no", "dept_no"]}) do |t|
|
29
|
+
t.column("emp_no", :"integer", **{:null=>false, :limit=>4})
|
30
|
+
t.column("dept_no", :"string", **{:null=>false, :limit=>255})
|
31
|
+
t.column("from_date", :"date", **{:null=>false})
|
32
|
+
t.column("to_date", :"date", **{:null=>false})
|
33
|
+
t.index(["dept_no"], **<%= {:name=>"dept_no"} + cond(5.0, using: :btree) %>)
|
34
|
+
t.index(["emp_no"], **<%= {:name=>"emp_no"} + cond(5.0, using: :btree) %>)
|
35
35
|
end
|
36
36
|
ERB
|
37
37
|
|
@@ -20,11 +20,11 @@ describe 'Ridgepole::Client#diff -> migrate' do
|
|
20
20
|
expect(delta.differ?).to be_truthy
|
21
21
|
|
22
22
|
expect(delta.script).to match_fuzzy <<-RUBY
|
23
|
-
create_table("employee_clubs", {:options=>"ENGINE=MyISAM CHARSET=utf8"}) do |t|
|
24
|
-
t.column("emp_no", :"integer", {:null=>false, :unsigned=>true, :limit=>4})
|
25
|
-
t.column("club_id", :"integer", {:null=>false, :unsigned=>true, :limit=>4})
|
23
|
+
create_table("employee_clubs", **{:options=>"ENGINE=MyISAM CHARSET=utf8"}) do |t|
|
24
|
+
t.column("emp_no", :"integer", **{:null=>false, :unsigned=>true, :limit=>4})
|
25
|
+
t.column("club_id", :"integer", **{:null=>false, :unsigned=>true, :limit=>4})
|
26
26
|
end
|
27
|
-
add_index("employee_clubs", ["emp_no", "club_id"], {:name=>"idx_emp_no_club_id", :using=>:btree})
|
27
|
+
add_index("employee_clubs", ["emp_no", "club_id"], **{:name=>"idx_emp_no_club_id", :using=>:btree})
|
28
28
|
RUBY
|
29
29
|
}
|
30
30
|
end
|
@@ -48,11 +48,11 @@ describe 'Ridgepole::Client#diff -> migrate' do
|
|
48
48
|
expect(delta.differ?).to be_truthy
|
49
49
|
|
50
50
|
expect(delta.script).to match_fuzzy <<-RUBY
|
51
|
-
create_table("employee_clubs", {:options=>"ENGINE=InnoDB CHARSET=utf8mb4"}) do |t|
|
52
|
-
t.column("emp_no", :"integer", {:null=>false, :unsigned=>true, :limit=>4})
|
53
|
-
t.column("club_id", :"integer", {:null=>false, :unsigned=>true, :limit=>4})
|
51
|
+
create_table("employee_clubs", **{:options=>"ENGINE=InnoDB CHARSET=utf8mb4"}) do |t|
|
52
|
+
t.column("emp_no", :"integer", **{:null=>false, :unsigned=>true, :limit=>4})
|
53
|
+
t.column("club_id", :"integer", **{:null=>false, :unsigned=>true, :limit=>4})
|
54
54
|
end
|
55
|
-
add_index("employee_clubs", ["emp_no", "club_id"], {:name=>"idx_emp_no_club_id", :using=>:btree})
|
55
|
+
add_index("employee_clubs", ["emp_no", "club_id"], **{:name=>"idx_emp_no_club_id", :using=>:btree})
|
56
56
|
RUBY
|
57
57
|
}
|
58
58
|
end
|
@@ -138,23 +138,23 @@ describe 'Ridgepole::Client#diff -> migrate' do
|
|
138
138
|
expect(delta.differ?).to be_truthy
|
139
139
|
expect(subject.dump).to match_ruby actual_dsl
|
140
140
|
expect(delta.script).to match_fuzzy <<-RUBY
|
141
|
-
change_table("dept_emp",
|
141
|
+
change_table("dept_emp", bulk: true) do |t|
|
142
142
|
t.remove("emp_no")
|
143
143
|
t.remove("from_date")
|
144
144
|
t.remove("to_date")
|
145
145
|
end
|
146
146
|
|
147
|
-
change_table("dept_manager",
|
147
|
+
change_table("dept_manager", bulk: true) do |t|
|
148
148
|
t.remove("emp_no")
|
149
149
|
t.remove("from_date")
|
150
150
|
t.remove("to_date")
|
151
151
|
end
|
152
152
|
|
153
|
-
change_table("employee_clubs",
|
153
|
+
change_table("employee_clubs", bulk: true) do |t|
|
154
154
|
t.remove("club_id")
|
155
155
|
end
|
156
156
|
|
157
|
-
change_table("employees",
|
157
|
+
change_table("employees", bulk: true) do |t|
|
158
158
|
t.remove("last_name")
|
159
159
|
t.remove("gender")
|
160
160
|
t.remove("hire_date")
|
@@ -135,17 +135,17 @@ describe 'Ridgepole::Client#diff -> migrate' do
|
|
135
135
|
expect(delta.differ?).to be_truthy
|
136
136
|
expect(subject.dump).to match_ruby actual_dsl
|
137
137
|
expect(delta.script).to match_fuzzy <<-RUBY
|
138
|
-
change_table("dept_emp",
|
138
|
+
change_table("dept_emp", bulk: true) do |t|
|
139
139
|
t.remove("from_date")
|
140
140
|
t.remove("to_date")
|
141
141
|
end
|
142
142
|
|
143
|
-
change_table("dept_manager",
|
143
|
+
change_table("dept_manager", bulk: true) do |t|
|
144
144
|
t.remove("from_date")
|
145
145
|
t.remove("to_date")
|
146
146
|
end
|
147
147
|
|
148
|
-
change_table("employees",
|
148
|
+
change_table("employees", bulk: true) do |t|
|
149
149
|
t.remove("last_name")
|
150
150
|
t.remove("gender")
|
151
151
|
t.remove("hire_date")
|
@@ -141,16 +141,16 @@ describe 'Ridgepole::Client#diff -> migrate' do
|
|
141
141
|
expect(delta.differ?).to be_truthy
|
142
142
|
expect(subject.dump).to match_ruby actual_dsl
|
143
143
|
expect(delta.script).to match_fuzzy <<-RUBY
|
144
|
-
change_table("clubs",
|
145
|
-
t.remove_index(
|
144
|
+
change_table("clubs", bulk: true) do |t|
|
145
|
+
t.remove_index(name: "idx_name")
|
146
146
|
end
|
147
147
|
|
148
|
-
change_table("employee_clubs",
|
149
|
-
t.remove_index(
|
148
|
+
change_table("employee_clubs", bulk: true) do |t|
|
149
|
+
t.remove_index(name: "idx_emp_no_club_id")
|
150
150
|
end
|
151
151
|
|
152
|
-
change_table("titles",
|
153
|
-
t.remove_index(
|
152
|
+
change_table("titles", bulk: true) do |t|
|
153
|
+
t.remove_index(name: "emp_no")
|
154
154
|
end
|
155
155
|
RUBY
|
156
156
|
delta.migrate
|
@@ -142,15 +142,15 @@ describe 'Ridgepole::Client#diff -> migrate' do
|
|
142
142
|
expect(delta.differ?).to be_truthy
|
143
143
|
expect(subject.dump).to match_ruby actual_dsl
|
144
144
|
expect(delta.script).to match_fuzzy <<-RUBY
|
145
|
-
change_table("dept_emp",
|
145
|
+
change_table("dept_emp", bulk: true) do |t|
|
146
146
|
t.rename("from_date", "from_date2")
|
147
147
|
end
|
148
148
|
|
149
|
-
change_table("dept_manager",
|
149
|
+
change_table("dept_manager", bulk: true) do |t|
|
150
150
|
t.rename("to_date", "to_date2")
|
151
151
|
end
|
152
152
|
|
153
|
-
change_table("employees",
|
153
|
+
change_table("employees", bulk: true) do |t|
|
154
154
|
t.rename("gender", "gender2")
|
155
155
|
end
|
156
156
|
RUBY
|
@@ -80,7 +80,7 @@ describe 'Ridgepole::Client#diff -> migrate' do
|
|
80
80
|
expect(subject.dump).to match_ruby actual_dsl
|
81
81
|
|
82
82
|
errmsg = Regexp.new(Regexp.escape(<<-MSG.strip))
|
83
|
-
33: add_index("employee_clubs", ["emp_no", "Xclub_id"], {:name=>"idx_emp_no_club_id", :using=>:btree})
|
83
|
+
33: add_index("employee_clubs", ["emp_no", "Xclub_id"], **{:name=>"idx_emp_no_club_id", :using=>:btree})
|
84
84
|
MSG
|
85
85
|
|
86
86
|
expect do
|
@@ -36,7 +36,7 @@ describe 'Ridgepole::Client#diff -> migrate' do
|
|
36
36
|
expect(delta.differ?).to be_truthy
|
37
37
|
expect(subject.dump).to match_ruby actual_dsl
|
38
38
|
expect(delta.script).to match_fuzzy <<-RUBY
|
39
|
-
add_foreign_key("child", "parent", {:name=>"fk_rails_e74ce85cbc"})
|
39
|
+
add_foreign_key("child", "parent", **{:name=>"fk_rails_e74ce85cbc"})
|
40
40
|
RUBY
|
41
41
|
delta.migrate
|
42
42
|
expect(subject.dump).to match_ruby expected_dsl
|
@@ -50,7 +50,7 @@ describe 'Ridgepole::Client#diff -> migrate' do
|
|
50
50
|
expect(delta.differ?).to be_truthy
|
51
51
|
expect(subject.dump).to match_fuzzy sorted_actual_dsl
|
52
52
|
expect(delta.script).to match_fuzzy <<-RUBY
|
53
|
-
remove_foreign_key("child",
|
53
|
+
remove_foreign_key("child", name: "fk_rails_e74ce85cbc")
|
54
54
|
RUBY
|
55
55
|
delta.migrate
|
56
56
|
expect(subject.dump).to match_ruby expected_dsl
|
@@ -25,13 +25,13 @@ describe 'Ridgepole::Client#diff -> migrate (with index)', condition: '>= 5.1.0'
|
|
25
25
|
expect(delta.differ?).to be_truthy
|
26
26
|
|
27
27
|
expect(delta.script).to match_fuzzy erbh(<<-ERB)
|
28
|
-
create_table("dept_emp", {:primary_key=>["emp_no", "dept_no"]}) do |t|
|
29
|
-
t.column("emp_no", :"integer", {:null=>false, :limit=>4})
|
30
|
-
t.column("dept_no", :"integer", {:null=>false, :auto_increment=>true, :limit=>4})
|
31
|
-
t.column("from_date", :"date", {:null=>false})
|
32
|
-
t.column("to_date", :"date", {:null=>false})
|
33
|
-
t.index(["dept_no"],
|
34
|
-
t.index(["emp_no"],
|
28
|
+
create_table("dept_emp", **{:primary_key=>["emp_no", "dept_no"]}) do |t|
|
29
|
+
t.column("emp_no", :"integer", **{:null=>false, :limit=>4})
|
30
|
+
t.column("dept_no", :"integer", **{:null=>false, :auto_increment=>true, :limit=>4})
|
31
|
+
t.column("from_date", :"date", **{:null=>false})
|
32
|
+
t.column("to_date", :"date", **{:null=>false})
|
33
|
+
t.index(["dept_no"], **<%= {:name=>"dept_no"} + cond(5.0, using: :btree) %>)
|
34
|
+
t.index(["emp_no"], **<%= {:name=>"emp_no"} + cond(5.0, using: :btree) %>)
|
35
35
|
end
|
36
36
|
ERB
|
37
37
|
|
@@ -148,9 +148,9 @@ describe 'Ridgepole::Client.diff' do
|
|
148
148
|
delta = subject.diff(actual_dsl, expected_dsl)
|
149
149
|
expect(delta.differ?).to be_truthy
|
150
150
|
expect(delta.script).to match_fuzzy <<-RUBY
|
151
|
-
change_column("employee_clubs", "club_id", :integer, {:null=>true, :default=>nil})
|
151
|
+
change_column("employee_clubs", "club_id", :integer, **{:null=>true, :default=>nil})
|
152
152
|
|
153
|
-
change_column("employees", "last_name", :string, {:limit=>20, :default=>"XXX"})
|
153
|
+
change_column("employees", "last_name", :string, **{:limit=>20, :default=>"XXX"})
|
154
154
|
RUBY
|
155
155
|
}
|
156
156
|
end
|
@@ -36,7 +36,7 @@ describe 'Ridgepole::Client#diff -> migrate' do
|
|
36
36
|
expect(delta.differ?).to be_truthy
|
37
37
|
expect(subject.dump).to match_ruby actual_dsl
|
38
38
|
expect(delta.script).to match_fuzzy <<-RUBY
|
39
|
-
add_foreign_key("child", "parent", {:name=>"child_ibfk_1"})
|
39
|
+
add_foreign_key("child", "parent", **{:name=>"child_ibfk_1"})
|
40
40
|
RUBY
|
41
41
|
delta.migrate
|
42
42
|
expect(subject.dump).to match_ruby expected_dsl
|
@@ -147,7 +147,7 @@ describe 'Ridgepole::Client#diff -> migrate' do
|
|
147
147
|
expect(delta.differ?).to be_truthy
|
148
148
|
expect(subject.dump).to match_ruby actual_dsl
|
149
149
|
expect(delta.script).to match_fuzzy <<-RUBY
|
150
|
-
add_foreign_key("child", "parent", {})
|
150
|
+
add_foreign_key("child", "parent", **{})
|
151
151
|
RUBY
|
152
152
|
delta.migrate
|
153
153
|
expect(subject.dump).to match_ruby expected_dsl
|
@@ -50,7 +50,7 @@ describe 'Ridgepole::Client#diff -> migrate' do
|
|
50
50
|
expect(delta.differ?).to be_truthy
|
51
51
|
expect(subject.dump).to match_fuzzy sorted_actual_dsl
|
52
52
|
expect(delta.script).to match_fuzzy <<-RUBY
|
53
|
-
remove_foreign_key("child",
|
53
|
+
remove_foreign_key("child", name: "child_ibfk_1")
|
54
54
|
RUBY
|
55
55
|
delta.migrate
|
56
56
|
expect(subject.dump).to match_ruby expected_dsl
|
@@ -141,13 +141,13 @@ describe 'Ridgepole::Client#diff -> migrate' do
|
|
141
141
|
expect(delta.differ?).to be_truthy
|
142
142
|
expect(subject.dump).to match_ruby actual_dsl
|
143
143
|
expect(delta.script).to match_fuzzy <<-RUBY
|
144
|
-
change_table("employee_clubs",
|
145
|
-
t.column("any_col", :string, {:limit=>255, :null=>false})
|
144
|
+
change_table("employee_clubs", bulk: true) do |t|
|
145
|
+
t.column("any_col", :string, **{:limit=>255, :null=>false})
|
146
146
|
end
|
147
147
|
|
148
|
-
change_table("employees",
|
149
|
-
t.column("age", :integer, {:null=>false})
|
150
|
-
t.column("updated_at", :date, {})
|
148
|
+
change_table("employees", bulk: true) do |t|
|
149
|
+
t.column("age", :integer, **{:null=>false})
|
150
|
+
t.column("updated_at", :date, **{})
|
151
151
|
end
|
152
152
|
RUBY
|
153
153
|
delta.migrate
|
@@ -138,12 +138,12 @@ describe 'Ridgepole::Client#diff -> migrate' do
|
|
138
138
|
expect(delta.differ?).to be_truthy
|
139
139
|
expect(subject.dump).to match_ruby actual_dsl
|
140
140
|
expect(delta.script).to match_fuzzy <<-RUBY
|
141
|
-
change_table("employee_clubs",
|
142
|
-
t.change("club_id", :integer, {:null=>true, :default=>nil})
|
141
|
+
change_table("employee_clubs", bulk: true) do |t|
|
142
|
+
t.change("club_id", :integer, **{:null=>true, :default=>nil})
|
143
143
|
end
|
144
144
|
|
145
|
-
change_table("employees",
|
146
|
-
t.change("last_name", :string, {:limit=>20, :default=>"XXX"})
|
145
|
+
change_table("employees", bulk: true) do |t|
|
146
|
+
t.change("last_name", :string, **{:limit=>20, :default=>"XXX"})
|
147
147
|
end
|
148
148
|
RUBY
|
149
149
|
delta.migrate
|
@@ -140,19 +140,19 @@ describe 'Ridgepole::Client#diff -> migrate' do
|
|
140
140
|
expect(delta.differ?).to be_truthy
|
141
141
|
expect(subject.dump).to match_ruby actual_dsl
|
142
142
|
expect(delta.script).to match_fuzzy <<-RUBY
|
143
|
-
change_table("dept_emp",
|
144
|
-
t.remove_index(
|
145
|
-
t.index(["from_date"], {:name=>"idx_dept_emp_emp_no", :using=>:btree, :unique=>false})
|
143
|
+
change_table("dept_emp", bulk: true) do |t|
|
144
|
+
t.remove_index(name: "idx_dept_emp_emp_no")
|
145
|
+
t.index(["from_date"], **{:name=>"idx_dept_emp_emp_no", :using=>:btree, :unique=>false})
|
146
146
|
end
|
147
147
|
|
148
|
-
change_table("dept_manager",
|
149
|
-
t.remove_index(
|
150
|
-
t.index(["from_date"], {:name=>"idx_dept_manager_emp_no", :using=>:btree, :unique=>false})
|
148
|
+
change_table("dept_manager", bulk: true) do |t|
|
149
|
+
t.remove_index(name: "idx_dept_manager_emp_no")
|
150
|
+
t.index(["from_date"], **{:name=>"idx_dept_manager_emp_no", :using=>:btree, :unique=>false})
|
151
151
|
end
|
152
152
|
|
153
|
-
change_table("salaries",
|
154
|
-
t.remove_index(
|
155
|
-
t.index(["from_date"], {:name=>"idx_salaries_emp_no", :using=>:btree, :unique=>false})
|
153
|
+
change_table("salaries", bulk: true) do |t|
|
154
|
+
t.remove_index(name: "idx_salaries_emp_no")
|
155
|
+
t.index(["from_date"], **{:name=>"idx_salaries_emp_no", :using=>:btree, :unique=>false})
|
156
156
|
end
|
157
157
|
RUBY
|
158
158
|
|
@@ -134,17 +134,17 @@ describe 'Ridgepole::Client#diff -> migrate' do
|
|
134
134
|
expect(delta.differ?).to be_truthy
|
135
135
|
expect(subject.dump).to match_ruby actual_dsl
|
136
136
|
expect(delta.script).to match_fuzzy <<-RUBY
|
137
|
-
change_table("dept_emp",
|
137
|
+
change_table("dept_emp", bulk: true) do |t|
|
138
138
|
t.remove("from_date")
|
139
139
|
t.remove("to_date")
|
140
140
|
end
|
141
141
|
|
142
|
-
change_table("dept_manager",
|
142
|
+
change_table("dept_manager", bulk: true) do |t|
|
143
143
|
t.remove("from_date")
|
144
144
|
t.remove("to_date")
|
145
145
|
end
|
146
146
|
|
147
|
-
change_table("employees",
|
147
|
+
change_table("employees", bulk: true) do |t|
|
148
148
|
t.remove("last_name")
|
149
149
|
t.remove("hire_date")
|
150
150
|
end
|
@@ -137,24 +137,24 @@ describe 'Ridgepole::Client#diff -> migrate' do
|
|
137
137
|
expect(delta.differ?).to be_truthy
|
138
138
|
expect(subject.dump).to match_ruby actual_dsl
|
139
139
|
expect(delta.script).to match_fuzzy erbh(<<-ERB)
|
140
|
-
change_table("dept_emp",
|
140
|
+
change_table("dept_emp", bulk: true) do |t|
|
141
141
|
t.remove("emp_no")
|
142
142
|
t.remove("from_date")
|
143
143
|
t.remove("to_date")
|
144
144
|
end
|
145
145
|
|
146
|
-
change_table("dept_manager",
|
146
|
+
change_table("dept_manager", bulk: true) do |t|
|
147
147
|
t.remove("emp_no")
|
148
148
|
t.remove("from_date")
|
149
149
|
t.remove("to_date")
|
150
150
|
end
|
151
151
|
|
152
|
-
change_table("employee_clubs",
|
152
|
+
change_table("employee_clubs", bulk: true) do |t|
|
153
153
|
t.remove("club_id")
|
154
|
-
t.index(["emp_no"],
|
154
|
+
t.index(["emp_no"], **<%= {:name=>"idx_employee_clubs_emp_no"} + cond(5.0, using: :btree) %>)
|
155
155
|
end
|
156
156
|
|
157
|
-
change_table("employees",
|
157
|
+
change_table("employees", bulk: true) do |t|
|
158
158
|
t.remove("last_name")
|
159
159
|
t.remove("hire_date")
|
160
160
|
end
|
@@ -50,7 +50,7 @@ describe 'Ridgepole::Client#diff -> migrate' do
|
|
50
50
|
specify do
|
51
51
|
delta = subject.diff(expected_dsl)
|
52
52
|
expect(delta).to be_differ
|
53
|
-
expect(delta.script).to match_fuzzy('remove_index("users",
|
53
|
+
expect(delta.script).to match_fuzzy('remove_index("users", name: "index_users_on_lower_name")')
|
54
54
|
expect(subject.dump).to match_fuzzy(actual_dsl)
|
55
55
|
delta.migrate
|
56
56
|
expect(subject.dump).to match_fuzzy(expected_dsl)
|
@@ -139,16 +139,16 @@ describe 'Ridgepole::Client#diff -> migrate' do
|
|
139
139
|
expect(delta.differ?).to be_truthy
|
140
140
|
expect(subject.dump).to match_ruby actual_dsl
|
141
141
|
expect(delta.script).to match_fuzzy <<-RUBY
|
142
|
-
change_table("clubs",
|
143
|
-
t.remove_index(
|
142
|
+
change_table("clubs", bulk: true) do |t|
|
143
|
+
t.remove_index(name: "idx_name")
|
144
144
|
end
|
145
145
|
|
146
|
-
change_table("employee_clubs",
|
147
|
-
t.remove_index(
|
146
|
+
change_table("employee_clubs", bulk: true) do |t|
|
147
|
+
t.remove_index(name: "idx_employee_clubs_emp_no_club_id")
|
148
148
|
end
|
149
149
|
|
150
|
-
change_table("titles",
|
151
|
-
t.remove_index(
|
150
|
+
change_table("titles", bulk: true) do |t|
|
151
|
+
t.remove_index(name: "idx_titles_emp_no")
|
152
152
|
end
|
153
153
|
RUBY
|
154
154
|
delta.migrate
|
@@ -140,11 +140,11 @@ describe 'Ridgepole::Client#diff -> migrate' do
|
|
140
140
|
expect(delta.differ?).to be_truthy
|
141
141
|
expect(subject.dump).to match_ruby actual_dsl
|
142
142
|
expect(delta.script).to match_fuzzy <<-RUBY
|
143
|
-
change_table("dept_emp",
|
143
|
+
change_table("dept_emp", bulk: true) do |t|
|
144
144
|
t.rename("from_date", "from_date2")
|
145
145
|
end
|
146
146
|
|
147
|
-
change_table("dept_manager",
|
147
|
+
change_table("dept_manager", bulk: true) do |t|
|
148
148
|
t.rename("to_date", "to_date2")
|
149
149
|
end
|
150
150
|
RUBY
|
@@ -36,7 +36,7 @@ describe 'Ridgepole::Client#diff -> migrate' do
|
|
36
36
|
expect(delta.differ?).to be_truthy
|
37
37
|
expect(subject.dump).to match_ruby actual_dsl
|
38
38
|
expect(delta.script).to match_fuzzy <<-RUBY
|
39
|
-
add_foreign_key("child", "parent", {:name=>"fk_rails_e74ce85cbc"})
|
39
|
+
add_foreign_key("child", "parent", **{:name=>"fk_rails_e74ce85cbc"})
|
40
40
|
RUBY
|
41
41
|
delta.migrate
|
42
42
|
expect(subject.dump).to match_ruby expected_dsl
|
@@ -50,7 +50,7 @@ describe 'Ridgepole::Client#diff -> migrate' do
|
|
50
50
|
expect(delta.differ?).to be_truthy
|
51
51
|
expect(subject.dump).to match_fuzzy sorted_actual_dsl
|
52
52
|
expect(delta.script).to match_fuzzy <<-RUBY
|
53
|
-
remove_foreign_key("child",
|
53
|
+
remove_foreign_key("child", name: "fk_rails_e74ce85cbc")
|
54
54
|
RUBY
|
55
55
|
delta.migrate
|
56
56
|
expect(subject.dump).to match_ruby expected_dsl
|
data/spec/spec_condition.rb
CHANGED
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.8.
|
4
|
+
version: 0.8.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Genki Sugawara
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-07-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|