ridgepole 0.7.1 → 0.7.2.beta
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/.travis.yml +4 -3
- data/Appraisals +8 -0
- data/README.md +2 -0
- data/docker-compose.yml +2 -2
- data/gemfiles/activerecord_5.2.gemfile +11 -0
- data/lib/ridgepole/ext/schema_dumper.rb +1 -1
- data/lib/ridgepole/schema_statements_ext.rb +2 -2
- data/lib/ridgepole/version.rb +1 -1
- data/ridgepole.gemspec +1 -0
- data/spec/erb_helper.rb +3 -1
- data/spec/mysql/_migrate/migrate_change_table_option_spec.rb +5 -5
- data/spec/mysql/bigint_pk/int_pk_spec.rb +2 -2
- data/spec/mysql/collation/collation_spec.rb +15 -15
- data/spec/mysql/comment/comment_spec.rb +10 -10
- data/spec/mysql/default_lambda/default_lambda_spec.rb +2 -2
- data/spec/mysql/diff/diff2_spec.rb +4 -4
- data/spec/mysql/diff/diff_spec.rb +4 -4
- data/spec/mysql/dump/dump_class_method_spec.rb +3 -3
- data/spec/mysql/dump/dump_some_tables_spec.rb +2 -2
- data/spec/mysql/dump/dump_spec.rb +3 -3
- data/spec/mysql/dump/dump_unknown_column_type_spec.rb +1 -1
- data/spec/mysql/dump/dump_without_table_options_spec.rb +2 -2
- data/spec/mysql/fk/migrate_change_fk_spec.rb +16 -16
- data/spec/mysql/fk/migrate_create_fk_spec.rb +14 -14
- data/spec/mysql/fk/migrate_drop_fk_spec.rb +18 -18
- data/spec/mysql/migrate/migrate_add_column2_spec.rb +8 -8
- data/spec/mysql/migrate/migrate_add_column_order_spec.rb +12 -12
- data/spec/mysql/migrate/migrate_add_column_spec.rb +4 -4
- data/spec/mysql/migrate/migrate_add_column_with_alter_extra_spec.rb +2 -2
- data/spec/mysql/migrate/migrate_add_column_with_script_spec.rb +2 -2
- data/spec/mysql/migrate/migrate_change_column2_spec.rb +2 -2
- data/spec/mysql/migrate/migrate_change_column3_spec.rb +14 -14
- data/spec/mysql/migrate/migrate_change_column5_spec.rb +4 -4
- data/spec/mysql/migrate/migrate_change_column6_spec.rb +11 -11
- data/spec/mysql/migrate/migrate_change_column7_spec.rb +2 -2
- data/spec/mysql/migrate/migrate_change_column_default_spec.rb +20 -20
- data/spec/mysql/migrate/migrate_change_column_float_spec.rb +9 -4
- data/spec/mysql/migrate/migrate_change_column_spec.rb +7 -7
- data/spec/mysql/migrate/migrate_change_index2_spec.rb +2 -2
- data/spec/mysql/migrate/migrate_change_index3_spec.rb +4 -4
- data/spec/mysql/migrate/migrate_change_index4_spec.rb +6 -6
- data/spec/mysql/migrate/migrate_change_index5_spec.rb +2 -2
- data/spec/mysql/migrate/migrate_change_index6_spec.rb +2 -2
- data/spec/mysql/migrate/migrate_change_index7_spec.rb +7 -7
- data/spec/mysql/migrate/migrate_change_index8_spec.rb +7 -7
- data/spec/mysql/migrate/migrate_change_index_spec.rb +3 -3
- data/spec/mysql/migrate/migrate_change_table_option_spec.rb +4 -4
- data/spec/mysql/migrate/migrate_check_relation_column_type_spec.rb +8 -8
- data/spec/mysql/migrate/migrate_create_index2_spec.rb +2 -2
- data/spec/mysql/migrate/migrate_create_index_spec.rb +4 -4
- data/spec/mysql/migrate/migrate_create_table_spec.rb +2 -2
- data/spec/mysql/migrate/migrate_create_table_with_index_spec.rb +2 -2
- data/spec/mysql/migrate/migrate_create_table_with_script_spec.rb +2 -2
- data/spec/mysql/migrate/migrate_drop_column_and_index2_spec.rb +4 -4
- data/spec/mysql/migrate/migrate_drop_column_and_index_spec.rb +6 -6
- data/spec/mysql/migrate/migrate_drop_column_and_unique_index_spec.rb +4 -4
- data/spec/mysql/migrate/migrate_drop_column_spec.rb +4 -4
- data/spec/mysql/migrate/migrate_drop_index_spec.rb +4 -4
- data/spec/mysql/migrate/migrate_drop_table_spec.rb +2 -2
- data/spec/mysql/migrate/migrate_empty_spec.rb +2 -2
- data/spec/mysql/migrate/migrate_execute_spec.rb +23 -23
- data/spec/mysql/migrate/migrate_log_file_spec.rb +2 -2
- data/spec/mysql/migrate/migrate_merge_mode_spec.rb +2 -2
- data/spec/mysql/migrate/migrate_noop_spec.rb +27 -27
- data/spec/mysql/migrate/migrate_primary_key_spec.rb +2 -2
- data/spec/mysql/migrate/migrate_rename_column_spec.rb +4 -4
- data/spec/mysql/migrate/migrate_rename_table_spec.rb +4 -4
- data/spec/mysql/migrate/migrate_same_default_null_spec.rb +4 -4
- data/spec/mysql/migrate/migrate_same_spec.rb +5 -5
- data/spec/mysql/migrate/migrate_script_error_spec.rb +1 -1
- data/spec/mysql/migrate/migrate_skip_drop_table_spec.rb +2 -2
- data/spec/mysql/migrate/migrate_skip_rename_column_spec.rb +2 -2
- data/spec/mysql/migrate/migrate_skip_rename_table_spec.rb +2 -2
- data/spec/mysql/migrate/migrate_with_ignore_tables_spec.rb +2 -2
- data/spec/mysql/migrate/migrate_with_pre_post_query_spec.rb +2 -2
- data/spec/mysql/migrate/migrate_with_tables_spec.rb +2 -2
- data/spec/mysql/migrate/migrate_with_verbose_log_spec.rb +2 -2
- data/spec/mysql/migrate_/migrate_create_index_with_alter_spec.rb +2 -2
- data/spec/mysql/migrate_/migrate_drop_index_with_alter_spec.rb +2 -2
- data/spec/mysql/text_blob_types/text_blob_types_spec.rb +1 -1
- data/spec/mysql/~default_name_fk/migrate_change_fk_spec.rb +4 -4
- data/spec/mysql/~default_name_fk/migrate_create_fk_spec.rb +9 -9
- data/spec/mysql/~default_name_fk/migrate_drop_fk_spec.rb +6 -6
- data/spec/mysql/~dump_auto_increment/migrate_create_table_with_index_spec.rb +2 -2
- data/spec/mysql57/json/add_json_column_spec.rb +2 -2
- data/spec/mysql57/json/change_json_column_spec.rb +6 -6
- data/spec/mysql57/json/drop_json_column_spec.rb +2 -2
- data/spec/mysql57/virtual/add_virtual_column_spec.rb +2 -2
- data/spec/mysql57/virtual/change_virtual_column_spec.rb +2 -2
- data/spec/mysql57/virtual/drop_virtual_column_spec.rb +2 -2
- data/spec/postgresql/dump/dump_spec.rb +3 -3
- data/spec/postgresql/fk/migrate_change_fk_spec.rb +2 -2
- data/spec/postgresql/fk/migrate_create_fk_spec.rb +8 -8
- data/spec/postgresql/fk/migrate_drop_fk_spec.rb +4 -4
- data/spec/postgresql/migrate/migrate_add_column_spec.rb +6 -6
- data/spec/postgresql/migrate/migrate_bigint_spec.rb +2 -2
- data/spec/postgresql/migrate/migrate_change_column_default_spec.rb +2 -2
- data/spec/postgresql/migrate/migrate_change_column_spec.rb +4 -4
- data/spec/postgresql/migrate/migrate_change_index_spec.rb +3 -3
- data/spec/postgresql/migrate/migrate_check_relation_column_type_spec.rb +4 -4
- data/spec/postgresql/migrate/migrate_create_table_spec.rb +2 -2
- data/spec/postgresql/migrate/migrate_create_table_with_default_proc_spec.rb +8 -8
- data/spec/postgresql/migrate/migrate_drop_column_spec.rb +4 -4
- data/spec/postgresql/migrate/migrate_drop_column_with_index_spec.rb +6 -6
- data/spec/postgresql/migrate/migrate_drop_index_spec.rb +4 -4
- data/spec/postgresql/migrate/migrate_drop_table_spec.rb +2 -2
- data/spec/postgresql/migrate/migrate_ext_cols_spec.rb +2 -2
- data/spec/postgresql/migrate/migrate_references_spec.rb +6 -6
- data/spec/postgresql/migrate/migrate_rename_column_spec.rb +4 -4
- data/spec/postgresql/migrate/migrate_rename_table_spec.rb +4 -4
- data/spec/postgresql/migrate/migrate_same_spec.rb +5 -5
- data/spec/postgresql/~default_name_fk/migrate_change_fk_spec.rb +1 -1
- data/spec/postgresql/~default_name_fk/migrate_create_fk_spec.rb +4 -4
- data/spec/postgresql/~default_name_fk/migrate_drop_fk_spec.rb +2 -2
- data/spec/spec_condition.rb +7 -0
- data/spec/spec_helper.rb +1 -0
- metadata +19 -4
|
@@ -76,9 +76,9 @@ describe 'Ridgepole::Client#diff -> migrate' do
|
|
|
76
76
|
it {
|
|
77
77
|
delta = subject.diff(dsl)
|
|
78
78
|
expect(delta.differ?).to be_truthy
|
|
79
|
-
expect(subject.dump).to
|
|
79
|
+
expect(subject.dump).to match_ruby actual_dsl
|
|
80
80
|
delta.migrate
|
|
81
|
-
expect(subject.dump).to
|
|
81
|
+
expect(subject.dump).to match_ruby expected_dsl
|
|
82
82
|
}
|
|
83
83
|
end
|
|
84
84
|
end
|
|
@@ -86,9 +86,9 @@ describe 'Ridgepole::Client#diff -> migrate' do
|
|
|
86
86
|
it {
|
|
87
87
|
delta = subject.diff(dsl)
|
|
88
88
|
expect(delta.differ?).to be_truthy
|
|
89
|
-
expect(subject.dump).to
|
|
89
|
+
expect(subject.dump).to match_ruby actual_dsl
|
|
90
90
|
delta.migrate
|
|
91
|
-
expect(subject.dump).to
|
|
91
|
+
expect(subject.dump).to match_ruby expected_dsl
|
|
92
92
|
}
|
|
93
93
|
end
|
|
94
94
|
|
|
@@ -169,9 +169,9 @@ describe 'Ridgepole::Client#diff -> migrate' do
|
|
|
169
169
|
it {
|
|
170
170
|
delta = subject.diff(dsl)
|
|
171
171
|
expect(delta.differ?).to be_truthy
|
|
172
|
-
expect(subject.dump).to
|
|
172
|
+
expect(subject.dump).to match_ruby actual_dsl
|
|
173
173
|
delta.migrate
|
|
174
|
-
expect(subject.dump).to
|
|
174
|
+
expect(subject.dump).to match_ruby expected_dsl
|
|
175
175
|
}
|
|
176
176
|
end
|
|
177
177
|
end
|
|
@@ -30,9 +30,9 @@ describe 'Ridgepole::Client#diff -> migrate' do
|
|
|
30
30
|
it {
|
|
31
31
|
delta = subject.diff(expected_dsl)
|
|
32
32
|
expect(delta.differ?).to be_truthy
|
|
33
|
-
expect(subject.dump).to
|
|
33
|
+
expect(subject.dump).to match_ruby actual_dsl
|
|
34
34
|
delta.migrate
|
|
35
|
-
expect(subject.dump).to
|
|
35
|
+
expect(subject.dump).to match_ruby expected_dsl
|
|
36
36
|
}
|
|
37
37
|
end
|
|
38
38
|
|
|
@@ -67,9 +67,9 @@ describe 'Ridgepole::Client#diff -> migrate' do
|
|
|
67
67
|
it {
|
|
68
68
|
delta = subject.diff(expected_dsl)
|
|
69
69
|
expect(delta.differ?).to be_truthy
|
|
70
|
-
expect(subject.dump).to
|
|
70
|
+
expect(subject.dump).to match_ruby actual_dsl
|
|
71
71
|
delta.migrate
|
|
72
|
-
expect(subject.dump).to
|
|
72
|
+
expect(subject.dump).to match_ruby expected_dsl
|
|
73
73
|
}
|
|
74
74
|
end
|
|
75
75
|
|
|
@@ -102,9 +102,9 @@ describe 'Ridgepole::Client#diff -> migrate' do
|
|
|
102
102
|
it {
|
|
103
103
|
delta = subject.diff(expected_dsl)
|
|
104
104
|
expect(delta.differ?).to be_truthy
|
|
105
|
-
expect(subject.dump).to
|
|
105
|
+
expect(subject.dump).to match_ruby actual_dsl
|
|
106
106
|
delta.migrate
|
|
107
|
-
expect(subject.dump).to
|
|
107
|
+
expect(subject.dump).to match_ruby expected_dsl
|
|
108
108
|
}
|
|
109
109
|
end
|
|
110
110
|
end
|
|
@@ -64,9 +64,9 @@ describe 'Ridgepole::Client#diff -> migrate' do
|
|
|
64
64
|
it {
|
|
65
65
|
delta = subject.diff(expected_dsl)
|
|
66
66
|
expect(delta.differ?).to be_truthy
|
|
67
|
-
expect(subject.dump).to
|
|
67
|
+
expect(subject.dump).to match_ruby actual_dsl
|
|
68
68
|
delta.migrate
|
|
69
|
-
expect(subject.dump).to
|
|
69
|
+
expect(subject.dump).to match_ruby expected_dsl
|
|
70
70
|
}
|
|
71
71
|
end
|
|
72
72
|
end
|
|
@@ -192,9 +192,9 @@ describe 'Ridgepole::Client#diff -> migrate' do
|
|
|
192
192
|
it {
|
|
193
193
|
delta = subject.diff(expected_dsl_using_t_index)
|
|
194
194
|
expect(delta.differ?).to be_truthy
|
|
195
|
-
expect(subject.dump).to
|
|
195
|
+
expect(subject.dump).to match_ruby actual_dsl
|
|
196
196
|
delta.migrate
|
|
197
|
-
expect(subject.dump).to
|
|
197
|
+
expect(subject.dump).to match_ruby expected_dsl
|
|
198
198
|
}
|
|
199
199
|
end
|
|
200
200
|
end
|
|
@@ -8,7 +8,7 @@ describe 'Ridgepole::Client#diff -> migrate' do
|
|
|
8
8
|
t.string "last_name", limit: 16, null: false
|
|
9
9
|
t.string "gender", limit: 1, null: false
|
|
10
10
|
t.date "hire_date", null: false
|
|
11
|
-
t.index ["first_name", "last_name"], name: "idx_first_name_last_name", length: { first_name: 10, last_name: 10 }, <%= i cond(5.0, using: :btree) %>
|
|
11
|
+
t.index ["first_name", "last_name"], name: "idx_first_name_last_name", length: <%= cond('< 5.2.0.beta2', '{ first_name: 10, last_name: 10 }', 10) %>, <%= i cond(5.0, using: :btree) %>
|
|
12
12
|
end
|
|
13
13
|
EOS
|
|
14
14
|
}
|
|
@@ -21,7 +21,7 @@ describe 'Ridgepole::Client#diff -> migrate' do
|
|
|
21
21
|
t.string "last_name", limit: 16, null: false
|
|
22
22
|
t.string "gender", limit: 1, null: false
|
|
23
23
|
t.date "hire_date", null: false
|
|
24
|
-
t.index ["first_name", "last_name"], name: "idx_first_name_last_name", length: 10, <%= i cond(5.0, using: :btree) %>
|
|
24
|
+
t.index ["first_name", "last_name"], name: "idx_first_name_last_name", length: <%= cond('< 5.2.0.beta2', 10, '{ first_name: 10, last_name: 10 }') %>, <%= i cond(5.0, using: :btree) %>
|
|
25
25
|
end
|
|
26
26
|
EOS
|
|
27
27
|
}
|
|
@@ -32,7 +32,7 @@ describe 'Ridgepole::Client#diff -> migrate' do
|
|
|
32
32
|
it {
|
|
33
33
|
delta = subject.diff(expected_dsl)
|
|
34
34
|
expect(delta.differ?).to be_falsy
|
|
35
|
-
expect(subject.dump).to
|
|
35
|
+
expect(subject.dump).to match_ruby actual_dsl
|
|
36
36
|
}
|
|
37
37
|
end
|
|
38
38
|
|
|
@@ -57,14 +57,14 @@ describe 'Ridgepole::Client#diff -> migrate' do
|
|
|
57
57
|
t.string "last_name", limit: 16, null: false
|
|
58
58
|
t.string "gender", limit: 1, null: false
|
|
59
59
|
t.date "hire_date", null: false
|
|
60
|
-
t.index ["first_name", "last_name"], name: "idx_first_name_last_name", length: 10, <%= i cond(5.0, using: :btree) %>
|
|
60
|
+
t.index ["first_name", "last_name"], name: "idx_first_name_last_name", length: <%= cond('< 5.2.0.beta2', 10, '{ first_name: 10, last_name: 10 }') %>, <%= i cond(5.0, using: :btree) %>
|
|
61
61
|
end
|
|
62
62
|
EOS
|
|
63
63
|
}
|
|
64
64
|
|
|
65
65
|
let(:actual_dsl_plus_index) {
|
|
66
66
|
actual_dsl.sub(/\bend\b/, erbh(<<-EOS))
|
|
67
|
-
t.index ["first_name", "last_name"], name: "idx_first_name_last_name", length: { first_name: 10, last_name: 10 }, <%= i cond(5.0, using: :btree) %>
|
|
67
|
+
t.index ["first_name", "last_name"], name: "idx_first_name_last_name", length: <%= cond('< 5.2.0.beta2', '{ first_name: 10, last_name: 10 }', 10) %>, <%= i cond(5.0, using: :btree) %>
|
|
68
68
|
end
|
|
69
69
|
EOS
|
|
70
70
|
}
|
|
@@ -75,9 +75,9 @@ describe 'Ridgepole::Client#diff -> migrate' do
|
|
|
75
75
|
it {
|
|
76
76
|
delta = subject.diff(expected_dsl)
|
|
77
77
|
expect(delta.differ?).to be_truthy
|
|
78
|
-
expect(subject.dump).to
|
|
78
|
+
expect(subject.dump).to match_ruby actual_dsl
|
|
79
79
|
delta.migrate
|
|
80
|
-
expect(subject.dump).to
|
|
80
|
+
expect(subject.dump).to match_ruby actual_dsl_plus_index
|
|
81
81
|
}
|
|
82
82
|
end
|
|
83
83
|
end
|
|
@@ -8,7 +8,7 @@ describe 'Ridgepole::Client#diff -> migrate' do
|
|
|
8
8
|
t.string "last_name", limit: 16, null: false
|
|
9
9
|
t.string "gender", limit: 1, null: false
|
|
10
10
|
t.date "hire_date", null: false
|
|
11
|
-
t.index ["first_name", "last_name"], name: "idx_first_name_last_name", length: { first_name: 10, last_name: 10 }, <%= i cond(5.0, using: :btree) %>
|
|
11
|
+
t.index ["first_name", "last_name"], name: "idx_first_name_last_name", length: <%= cond('< 5.2.0.beta2', '{ first_name: 10, last_name: 10 }', 10) %>, <%= i cond(5.0, using: :btree) %>
|
|
12
12
|
end
|
|
13
13
|
EOS
|
|
14
14
|
}
|
|
@@ -21,7 +21,7 @@ describe 'Ridgepole::Client#diff -> migrate' do
|
|
|
21
21
|
t.string "last_name", limit: 16, null: false
|
|
22
22
|
t.string "gender", limit: 1, null: false
|
|
23
23
|
t.date "hire_date", null: false
|
|
24
|
-
t.index ["first_name", "last_name"], name: "idx_first_name_last_name", length: { "first_name" => 10, "last_name" => 10, "foo" => nil }
|
|
24
|
+
t.index ["first_name", "last_name"], name: "idx_first_name_last_name", length: <%= cond('< 5.2.0.beta2', 10, '{ "first_name" => 10, "last_name" => 10, "foo" => nil }') %>, <%= i cond(5.0, using: :btree) %>
|
|
25
25
|
end
|
|
26
26
|
EOS
|
|
27
27
|
}
|
|
@@ -32,7 +32,7 @@ describe 'Ridgepole::Client#diff -> migrate' do
|
|
|
32
32
|
it {
|
|
33
33
|
delta = subject.diff(expected_dsl)
|
|
34
34
|
expect(delta.differ?).to be_falsy
|
|
35
|
-
expect(subject.dump).to
|
|
35
|
+
expect(subject.dump).to match_ruby actual_dsl
|
|
36
36
|
}
|
|
37
37
|
end
|
|
38
38
|
|
|
@@ -57,14 +57,14 @@ describe 'Ridgepole::Client#diff -> migrate' do
|
|
|
57
57
|
t.string "last_name", limit: 16, null: false
|
|
58
58
|
t.string "gender", limit: 1, null: false
|
|
59
59
|
t.date "hire_date", null: false
|
|
60
|
-
t.index ["first_name", "last_name"], name: "idx_first_name_last_name", length: { "first_name" => 10, "last_name" => 10 }
|
|
60
|
+
t.index ["first_name", "last_name"], name: "idx_first_name_last_name", length: <%= cond('< 5.2.0.beta2', 10, '{ "first_name" => 10, "last_name" => 10 }') %>, <%= i cond(5.0, using: :btree) %>
|
|
61
61
|
end
|
|
62
62
|
EOS
|
|
63
63
|
}
|
|
64
64
|
|
|
65
65
|
let(:actual_dsl_plus_index) {
|
|
66
66
|
actual_dsl.sub(/\bend\b/, erbh(<<-EOS))
|
|
67
|
-
t.index ["first_name", "last_name"], name: "idx_first_name_last_name", length: { first_name: 10, last_name: 10 }, <%= i cond(5.0, using: :btree) %>
|
|
67
|
+
t.index ["first_name", "last_name"], name: "idx_first_name_last_name", length: <%= cond('< 5.2.0.beta2', '{ first_name: 10, last_name: 10 }', 10) %>, <%= i cond(5.0, using: :btree) %>
|
|
68
68
|
end
|
|
69
69
|
EOS
|
|
70
70
|
}
|
|
@@ -75,9 +75,9 @@ describe 'Ridgepole::Client#diff -> migrate' do
|
|
|
75
75
|
it {
|
|
76
76
|
delta = subject.diff(expected_dsl)
|
|
77
77
|
expect(delta.differ?).to be_truthy
|
|
78
|
-
expect(subject.dump).to
|
|
78
|
+
expect(subject.dump).to match_ruby actual_dsl
|
|
79
79
|
delta.migrate
|
|
80
|
-
expect(subject.dump).to
|
|
80
|
+
expect(subject.dump).to match_ruby actual_dsl_plus_index
|
|
81
81
|
}
|
|
82
82
|
end
|
|
83
83
|
end
|
|
@@ -192,15 +192,15 @@ describe 'Ridgepole::Client#diff -> migrate' do
|
|
|
192
192
|
it {
|
|
193
193
|
delta = subject.diff(expected_dsl)
|
|
194
194
|
expect(delta.differ?).to be_truthy
|
|
195
|
-
expect(subject.dump).to
|
|
195
|
+
expect(subject.dump).to match_ruby actual_dsl
|
|
196
196
|
delta.migrate
|
|
197
|
-
expect(subject.dump).to
|
|
197
|
+
expect(subject.dump).to match_ruby expected_dsl
|
|
198
198
|
}
|
|
199
199
|
|
|
200
200
|
it {
|
|
201
201
|
delta = client(:bulk_change => true).diff(expected_dsl)
|
|
202
202
|
expect(delta.differ?).to be_truthy
|
|
203
|
-
expect(subject.dump).to
|
|
203
|
+
expect(subject.dump).to match_ruby actual_dsl
|
|
204
204
|
expect(delta.script).to match_fuzzy <<-EOS
|
|
205
205
|
change_table("dept_emp", {:bulk => true}) do |t|
|
|
206
206
|
t.remove_index({:name=>"emp_no"})
|
|
@@ -35,9 +35,9 @@ describe 'Ridgepole::Client#diff -> migrate' do
|
|
|
35
35
|
EOS
|
|
36
36
|
delta = subject.diff(expected_dsl)
|
|
37
37
|
expect(delta.differ?).to be_falsey
|
|
38
|
-
expect(subject.dump).to
|
|
38
|
+
expect(subject.dump).to match_ruby actual_dsl
|
|
39
39
|
delta.migrate
|
|
40
|
-
expect(subject.dump).to
|
|
40
|
+
expect(subject.dump).to match_ruby actual_dsl
|
|
41
41
|
}
|
|
42
42
|
end
|
|
43
43
|
|
|
@@ -73,9 +73,9 @@ describe 'Ridgepole::Client#diff -> migrate' do
|
|
|
73
73
|
expect(Ridgepole::Logger.instance).to_not receive(:warn)
|
|
74
74
|
delta = subject.diff(expected_dsl)
|
|
75
75
|
expect(delta.differ?).to be_falsey
|
|
76
|
-
expect(subject.dump).to
|
|
76
|
+
expect(subject.dump).to match_ruby actual_dsl
|
|
77
77
|
delta.migrate
|
|
78
|
-
expect(subject.dump).to
|
|
78
|
+
expect(subject.dump).to match_ruby actual_dsl
|
|
79
79
|
}
|
|
80
80
|
end
|
|
81
81
|
end
|
|
@@ -51,9 +51,9 @@ describe 'Ridgepole::Client#diff -> migrate', condition: 5.1 do
|
|
|
51
51
|
|
|
52
52
|
delta = subject.diff(expected_dsl)
|
|
53
53
|
expect(delta.differ?).to be_truthy
|
|
54
|
-
expect(subject.dump).to
|
|
54
|
+
expect(subject.dump).to match_ruby actual_dsl
|
|
55
55
|
delta.migrate
|
|
56
|
-
expect(subject.dump).to
|
|
56
|
+
expect(subject.dump).to match_ruby expected_dsl
|
|
57
57
|
}
|
|
58
58
|
end
|
|
59
59
|
|
|
@@ -109,9 +109,9 @@ describe 'Ridgepole::Client#diff -> migrate', condition: 5.1 do
|
|
|
109
109
|
|
|
110
110
|
delta = subject.diff(expected_dsl)
|
|
111
111
|
expect(delta.differ?).to be_truthy
|
|
112
|
-
expect(subject.dump).to
|
|
112
|
+
expect(subject.dump).to match_ruby actual_dsl
|
|
113
113
|
delta.migrate
|
|
114
|
-
expect(subject.dump).to
|
|
114
|
+
expect(subject.dump).to match_ruby expected_dsl
|
|
115
115
|
}
|
|
116
116
|
end
|
|
117
117
|
|
|
@@ -162,9 +162,9 @@ describe 'Ridgepole::Client#diff -> migrate', condition: 5.1 do
|
|
|
162
162
|
expect(Ridgepole::Logger.instance).to_not receive(:warn)
|
|
163
163
|
delta = subject.diff(expected_dsl)
|
|
164
164
|
expect(delta.differ?).to be_truthy
|
|
165
|
-
expect(subject.dump).to
|
|
165
|
+
expect(subject.dump).to match_ruby actual_dsl
|
|
166
166
|
delta.migrate
|
|
167
|
-
expect(subject.dump).to
|
|
167
|
+
expect(subject.dump).to match_ruby expected_dsl
|
|
168
168
|
}
|
|
169
169
|
end
|
|
170
170
|
|
|
@@ -215,9 +215,9 @@ describe 'Ridgepole::Client#diff -> migrate', condition: 5.1 do
|
|
|
215
215
|
expect(Ridgepole::Logger.instance).to_not receive(:warn)
|
|
216
216
|
delta = subject.diff(expected_dsl)
|
|
217
217
|
expect(delta.differ?).to be_truthy
|
|
218
|
-
expect(subject.dump).to
|
|
218
|
+
expect(subject.dump).to match_ruby actual_dsl
|
|
219
219
|
delta.migrate
|
|
220
|
-
expect(subject.dump).to
|
|
220
|
+
expect(subject.dump).to match_ruby expected_dsl
|
|
221
221
|
}
|
|
222
222
|
end
|
|
223
223
|
end
|
|
@@ -193,9 +193,9 @@ describe 'Ridgepole::Client#diff -> migrate' do
|
|
|
193
193
|
it {
|
|
194
194
|
delta = subject.diff(expected_dsl)
|
|
195
195
|
expect(delta.differ?).to be_truthy
|
|
196
|
-
expect(subject.dump).to
|
|
196
|
+
expect(subject.dump).to match_ruby actual_dsl
|
|
197
197
|
delta.migrate
|
|
198
|
-
expect(subject.dump).to
|
|
198
|
+
expect(subject.dump).to match_ruby dsl
|
|
199
199
|
}
|
|
200
200
|
end
|
|
201
201
|
end
|
|
@@ -129,15 +129,15 @@ describe 'Ridgepole::Client#diff -> migrate' do
|
|
|
129
129
|
it {
|
|
130
130
|
delta = subject.diff(expected_dsl)
|
|
131
131
|
expect(delta.differ?).to be_truthy
|
|
132
|
-
expect(subject.dump).to
|
|
132
|
+
expect(subject.dump).to match_ruby actual_dsl
|
|
133
133
|
delta.migrate
|
|
134
|
-
expect(subject.dump).to
|
|
134
|
+
expect(subject.dump).to match_ruby expected_dsl
|
|
135
135
|
}
|
|
136
136
|
|
|
137
137
|
it {
|
|
138
138
|
delta = client(:bulk_change => true).diff(expected_dsl)
|
|
139
139
|
expect(delta.differ?).to be_truthy
|
|
140
|
-
expect(subject.dump).to
|
|
140
|
+
expect(subject.dump).to match_ruby actual_dsl
|
|
141
141
|
expect(delta.script).to match_fuzzy erbh(<<-EOS)
|
|
142
142
|
change_table("clubs", {:bulk => true}) do |t|
|
|
143
143
|
t.index(["name"], <%= {:name=>"idx_name", :unique=>true} + cond(5.0, using: :btree) %>)
|
|
@@ -152,7 +152,7 @@ describe 'Ridgepole::Client#diff -> migrate' do
|
|
|
152
152
|
end
|
|
153
153
|
EOS
|
|
154
154
|
delta.migrate
|
|
155
|
-
expect(subject.dump).to
|
|
155
|
+
expect(subject.dump).to match_ruby expected_dsl
|
|
156
156
|
}
|
|
157
157
|
end
|
|
158
158
|
end
|
|
@@ -113,9 +113,9 @@ describe 'Ridgepole::Client#diff -> migrate' do
|
|
|
113
113
|
it {
|
|
114
114
|
delta = subject.diff(expected_dsl)
|
|
115
115
|
expect(delta.differ?).to be_truthy
|
|
116
|
-
expect(subject.dump).to
|
|
116
|
+
expect(subject.dump).to match_ruby actual_dsl
|
|
117
117
|
delta.migrate
|
|
118
|
-
expect(subject.dump).to
|
|
118
|
+
expect(subject.dump).to match_ruby expected_dsl
|
|
119
119
|
}
|
|
120
120
|
end
|
|
121
121
|
end
|
|
@@ -33,9 +33,9 @@ describe 'Ridgepole::Client#diff -> migrate (with index)' do
|
|
|
33
33
|
end
|
|
34
34
|
EOS
|
|
35
35
|
|
|
36
|
-
expect(subject.dump).to
|
|
36
|
+
expect(subject.dump).to match_ruby actual_dsl
|
|
37
37
|
delta.migrate
|
|
38
|
-
expect(subject.dump).to
|
|
38
|
+
expect(subject.dump).to match_ruby expected_dsl
|
|
39
39
|
}
|
|
40
40
|
end
|
|
41
41
|
end
|
|
@@ -113,7 +113,7 @@ describe 'Ridgepole::Client#diff -> migrate' do
|
|
|
113
113
|
it {
|
|
114
114
|
delta = subject.diff(expected_dsl)
|
|
115
115
|
expect(delta.differ?).to be_truthy
|
|
116
|
-
expect(subject.dump).to
|
|
116
|
+
expect(subject.dump).to match_ruby actual_dsl
|
|
117
117
|
|
|
118
118
|
script = <<-EOS
|
|
119
119
|
echo "$1" | #{MYSQL_CLI} #{TEST_SCHEMA}
|
|
@@ -124,7 +124,7 @@ describe 'Ridgepole::Client#diff -> migrate' do
|
|
|
124
124
|
delta.migrate(external_script: path)
|
|
125
125
|
end
|
|
126
126
|
|
|
127
|
-
expect(subject.dump).to
|
|
127
|
+
expect(subject.dump).to match_ruby expected_dsl
|
|
128
128
|
}
|
|
129
129
|
end
|
|
130
130
|
end
|
|
@@ -122,17 +122,17 @@ describe 'Ridgepole::Client#diff -> migrate' do
|
|
|
122
122
|
it {
|
|
123
123
|
delta = subject.diff(expected_dsl)
|
|
124
124
|
expect(delta.differ?).to be_truthy
|
|
125
|
-
expect(subject.dump).to
|
|
125
|
+
expect(subject.dump).to match_ruby actual_dsl
|
|
126
126
|
delta.migrate
|
|
127
|
-
expect(subject.dump).to
|
|
127
|
+
expect(subject.dump).to match_ruby expected_dsl
|
|
128
128
|
}
|
|
129
129
|
|
|
130
130
|
it {
|
|
131
131
|
delta = subject.diff(expected_dsl)
|
|
132
132
|
expect(delta.differ?).to be_truthy
|
|
133
|
-
expect(subject.dump).to
|
|
133
|
+
expect(subject.dump).to match_ruby actual_dsl
|
|
134
134
|
delta.migrate(:noop => true)
|
|
135
|
-
expect(subject.dump).to
|
|
135
|
+
expect(subject.dump).to match_ruby actual_dsl
|
|
136
136
|
}
|
|
137
137
|
end
|
|
138
138
|
end
|
|
@@ -118,23 +118,23 @@ describe 'Ridgepole::Client#diff -> migrate' do
|
|
|
118
118
|
it {
|
|
119
119
|
delta = subject.diff(expected_dsl)
|
|
120
120
|
expect(delta.differ?).to be_truthy
|
|
121
|
-
expect(subject.dump).to
|
|
121
|
+
expect(subject.dump).to match_ruby actual_dsl
|
|
122
122
|
delta.migrate
|
|
123
|
-
expect(subject.dump).to
|
|
123
|
+
expect(subject.dump).to match_ruby expected_dsl
|
|
124
124
|
}
|
|
125
125
|
|
|
126
126
|
it {
|
|
127
127
|
delta = subject.diff(expected_dsl)
|
|
128
128
|
expect(delta.differ?).to be_truthy
|
|
129
|
-
expect(subject.dump).to
|
|
129
|
+
expect(subject.dump).to match_ruby actual_dsl
|
|
130
130
|
delta.migrate(:noop => true)
|
|
131
|
-
expect(subject.dump).to
|
|
131
|
+
expect(subject.dump).to match_ruby actual_dsl
|
|
132
132
|
}
|
|
133
133
|
|
|
134
134
|
it {
|
|
135
135
|
delta = client(:bulk_change => true).diff(expected_dsl)
|
|
136
136
|
expect(delta.differ?).to be_truthy
|
|
137
|
-
expect(subject.dump).to
|
|
137
|
+
expect(subject.dump).to match_ruby actual_dsl
|
|
138
138
|
expect(delta.script).to match_fuzzy <<-EOS
|
|
139
139
|
change_table("dept_emp", {:bulk => true}) do |t|
|
|
140
140
|
t.remove("emp_no")
|
|
@@ -159,7 +159,7 @@ change_table("employees", {:bulk => true}) do |t|
|
|
|
159
159
|
end
|
|
160
160
|
EOS
|
|
161
161
|
delta.migrate
|
|
162
|
-
expect(subject.dump).to
|
|
162
|
+
expect(subject.dump).to match_ruby expected_dsl
|
|
163
163
|
}
|
|
164
164
|
end
|
|
165
165
|
end
|
|
@@ -34,17 +34,17 @@ describe 'Ridgepole::Client#diff -> migrate' do
|
|
|
34
34
|
it {
|
|
35
35
|
delta = subject.diff(expected_dsl)
|
|
36
36
|
expect(delta.differ?).to be_truthy
|
|
37
|
-
expect(subject.dump).to
|
|
37
|
+
expect(subject.dump).to match_ruby actual_dsl
|
|
38
38
|
delta.migrate
|
|
39
|
-
expect(subject.dump).to
|
|
39
|
+
expect(subject.dump).to match_ruby expected_dsl
|
|
40
40
|
}
|
|
41
41
|
|
|
42
42
|
it {
|
|
43
43
|
delta = subject.diff(expected_dsl)
|
|
44
44
|
expect(delta.differ?).to be_truthy
|
|
45
|
-
expect(subject.dump).to
|
|
45
|
+
expect(subject.dump).to match_ruby actual_dsl
|
|
46
46
|
delta.migrate(:noop => true)
|
|
47
|
-
expect(subject.dump).to
|
|
47
|
+
expect(subject.dump).to match_ruby actual_dsl
|
|
48
48
|
}
|
|
49
49
|
end
|
|
50
50
|
end
|