ridgepole 0.8.12 → 0.9.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/test.yml +27 -20
- data/.rubocop.yml +5 -4
- data/.simplecov +6 -0
- data/Appraisals +4 -5
- data/README.md +22 -41
- data/bin/ridgepole +13 -3
- data/gemfiles/{activerecord_5.0.gemfile → activerecord_6.1.gemfile} +1 -2
- data/lib/ridgepole/client.rb +8 -3
- data/lib/ridgepole/default_limit.rb +1 -1
- data/lib/ridgepole/delta.rb +16 -1
- data/lib/ridgepole/diff.rb +50 -31
- data/lib/ridgepole/dsl_parser/table_definition.rb +49 -42
- data/lib/ridgepole/execute_expander.rb +10 -1
- data/lib/ridgepole/ext/abstract_adapter/disable_table_options.rb +9 -1
- data/lib/ridgepole/external_sql_executer.rb +12 -1
- data/lib/ridgepole/version.rb +1 -1
- data/ridgepole.gemspec +6 -3
- data/spec/erb_helper.rb +1 -1
- data/spec/mysql/_migrate/migrate_change_table_option_spec.rb +2 -2
- data/spec/mysql/bigint_pk/int_pk_spec.rb +1 -1
- data/spec/mysql/cli/ridgepole_spec.rb +35 -1
- data/spec/mysql/collation/collation_spec.rb +14 -14
- data/spec/mysql/comment/comment_spec.rb +9 -9
- data/spec/mysql/diff/diff2_spec.rb +5 -5
- data/spec/mysql/diff/diff_spec.rb +3 -3
- data/spec/mysql/dump/dump_class_method_spec.rb +13 -13
- data/spec/mysql/dump/dump_some_tables_spec.rb +4 -4
- data/spec/mysql/dump/dump_spec.rb +13 -13
- data/spec/mysql/dump/dump_unknown_column_type_spec.rb +2 -2
- data/spec/mysql/dump/dump_without_table_options_spec.rb +2 -2
- data/spec/mysql/fk/migrate_change_fk2_spec.rb +2 -2
- data/spec/mysql/fk/migrate_change_fk_spec.rb +88 -20
- data/spec/mysql/fk/migrate_create_fk_spec.rb +77 -22
- data/spec/mysql/fk/migrate_drop_fk_spec.rb +81 -26
- data/spec/mysql/fk/migrate_fk_with_column_spec.rb +16 -16
- data/spec/mysql/fk/migrate_ignore_fk_spec.rb +6 -6
- data/spec/mysql/migrate/migrate_add_column_order_spec.rb +2 -2
- data/spec/mysql/migrate/migrate_add_column_spec.rb +18 -18
- data/spec/mysql/migrate/migrate_add_column_with_alter_extra_spec.rb +106 -18
- data/spec/mysql/migrate/migrate_add_column_with_script_spec.rb +18 -18
- data/spec/mysql/migrate/migrate_change_column2_spec.rb +5 -5
- data/spec/mysql/migrate/migrate_change_column3_spec.rb +10 -10
- data/spec/mysql/migrate/migrate_change_column5_spec.rb +3 -3
- data/spec/mysql/migrate/migrate_change_column6_spec.rb +7 -7
- data/spec/mysql/migrate/migrate_change_column8_spec.rb +38 -5
- data/spec/mysql/migrate/migrate_change_column_default_spec.rb +2 -14
- data/spec/mysql/migrate/migrate_change_column_spec.rb +21 -21
- data/spec/mysql/migrate/migrate_change_index2_spec.rb +5 -5
- data/spec/mysql/migrate/migrate_change_index3_spec.rb +7 -7
- data/spec/mysql/migrate/migrate_change_index4_spec.rb +6 -6
- data/spec/mysql/migrate/migrate_change_index5_spec.rb +4 -4
- data/spec/mysql/migrate/migrate_change_index6_spec.rb +27 -27
- data/spec/mysql/migrate/migrate_change_index7_spec.rb +4 -4
- data/spec/mysql/migrate/migrate_change_index8_spec.rb +4 -4
- data/spec/mysql/migrate/migrate_change_index_spec.rb +34 -28
- data/spec/mysql/migrate/migrate_check_relation_column_type_spec.rb +5 -5
- data/spec/mysql/migrate/migrate_create_index2_spec.rb +24 -24
- data/spec/mysql/migrate/migrate_create_index_spec.rb +18 -18
- data/spec/mysql/migrate/migrate_create_table_spec.rb +16 -16
- data/spec/mysql/migrate/migrate_create_table_with_ignore_spec.rb +4 -4
- data/spec/mysql/migrate/migrate_create_table_with_index_spec.rb +4 -4
- data/spec/mysql/migrate/migrate_create_table_with_script_spec.rb +16 -16
- data/spec/mysql/migrate/migrate_drop_column_and_index2_spec.rb +18 -18
- data/spec/mysql/migrate/migrate_drop_column_and_index_spec.rb +16 -16
- data/spec/mysql/migrate/migrate_drop_column_and_unique_index_spec.rb +1 -1
- data/spec/mysql/migrate/migrate_drop_column_spec.rb +18 -18
- data/spec/mysql/migrate/migrate_drop_index_spec.rb +15 -15
- data/spec/mysql/migrate/migrate_drop_table_spec.rb +16 -16
- data/spec/mysql/migrate/migrate_empty_spec.rb +9 -9
- data/spec/mysql/migrate/migrate_execute_spec.rb +32 -32
- data/spec/mysql/migrate/migrate_ignore_column_spec.rb +4 -4
- data/spec/mysql/migrate/migrate_ignore_index_spec.rb +5 -5
- data/spec/mysql/migrate/migrate_log_file_spec.rb +16 -16
- data/spec/mysql/migrate/migrate_merge_mode_spec.rb +18 -18
- data/spec/mysql/migrate/migrate_noop_spec.rb +12 -12
- data/spec/mysql/migrate/migrate_primary_key_spec.rb +31 -6
- data/spec/mysql/migrate/migrate_rename_column_spec.rb +18 -18
- data/spec/mysql/migrate/migrate_rename_table_spec.rb +22 -22
- data/spec/mysql/migrate/migrate_same_spec.rb +13 -13
- data/spec/mysql/migrate/migrate_skip_column_comment_change_spec.rb +2 -2
- data/spec/mysql/migrate/migrate_skip_drop_table_spec.rb +18 -18
- data/spec/mysql/migrate/migrate_skip_rename_column_spec.rb +18 -18
- data/spec/mysql/migrate/migrate_skip_rename_table_spec.rb +18 -18
- data/spec/mysql/migrate/migrate_with_pre_post_query_spec.rb +18 -18
- data/spec/mysql/text_blob_types/text_blob_types_spec.rb +2 -2
- data/spec/mysql/~default_name_fk/migrate_change_fk_spec.rb +6 -6
- data/spec/mysql/~default_name_fk/migrate_create_fk_spec.rb +9 -9
- data/spec/mysql/~default_name_fk/migrate_drop_fk_spec.rb +8 -8
- data/spec/mysql/~dump_auto_increment/migrate_create_table_with_index_spec.rb +5 -5
- 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 +1 -1
- data/spec/mysql57/virtual/change_virtual_column_spec.rb +1 -1
- data/spec/mysql57/virtual/drop_virtual_column_spec.rb +1 -1
- data/spec/postgresql/dump/dump_spec.rb +13 -13
- data/spec/postgresql/fk/migrate_change_fk_spec.rb +6 -6
- data/spec/postgresql/fk/migrate_create_fk_spec.rb +5 -5
- data/spec/postgresql/fk/migrate_drop_fk_spec.rb +8 -8
- data/spec/postgresql/migrate/migrate_add_column_spec.rb +27 -20
- data/spec/postgresql/migrate/migrate_add_expression_index_spec.rb +1 -1
- data/spec/postgresql/migrate/migrate_change_column_spec.rb +20 -16
- data/spec/postgresql/migrate/migrate_change_index_spec.rb +18 -18
- data/spec/postgresql/migrate/migrate_check_relation_column_type_spec.rb +1 -1
- data/spec/postgresql/migrate/migrate_create_table_spec.rb +14 -14
- data/spec/postgresql/migrate/migrate_drop_column_spec.rb +29 -22
- data/spec/postgresql/migrate/migrate_drop_column_with_index_spec.rb +17 -17
- data/spec/postgresql/migrate/migrate_drop_expression_index_spec.rb +3 -3
- data/spec/postgresql/migrate/migrate_drop_index_spec.rb +15 -15
- data/spec/postgresql/migrate/migrate_drop_table_spec.rb +16 -16
- data/spec/postgresql/migrate/migrate_primary_key2_spec.rb +1 -1
- data/spec/postgresql/migrate/migrate_primary_key_spec.rb +1 -1
- data/spec/postgresql/migrate/migrate_references_spec.rb +6 -6
- data/spec/postgresql/migrate/migrate_rename_column_spec.rb +18 -18
- data/spec/postgresql/migrate/migrate_rename_table_spec.rb +20 -20
- data/spec/postgresql/migrate/migrate_same_spec.rb +13 -13
- data/spec/postgresql/~default_name_fk/migrate_change_fk_spec.rb +3 -3
- data/spec/postgresql/~default_name_fk/migrate_create_fk_spec.rb +4 -4
- data/spec/postgresql/~default_name_fk/migrate_drop_fk_spec.rb +4 -4
- data/spec/processing_for_ci.rb +13 -0
- data/spec/spec_const.rb +1 -1
- data/spec/spec_helper.rb +2 -1
- metadata +68 -43
- data/lib/ridgepole/ext/abstract_mysql_adapter/use_alter_index.rb +0 -31
- data/omnibus-ridgepole/.gitignore +0 -10
- data/omnibus-ridgepole/Dockerfile.centos +0 -25
- data/omnibus-ridgepole/Dockerfile.ubuntu +0 -21
- data/omnibus-ridgepole/Gemfile +0 -24
- data/omnibus-ridgepole/README.md +0 -15
- data/omnibus-ridgepole/Rakefile +0 -38
- data/omnibus-ridgepole/config/projects/ridgepole.rb +0 -27
- data/omnibus-ridgepole/config/software/ridgepole.rb +0 -13
- data/omnibus-ridgepole/omnibus.rb +0 -54
- data/omnibus-ridgepole/package-scripts/ridgepole/postinst +0 -1
- data/omnibus-ridgepole/package-scripts/ridgepole/postrm +0 -1
- data/spec/mysql/bigint_pk/bigint_pk_spec.rb +0 -47
- data/spec/mysql/migrate_/migrate_create_index_with_alter_spec.rb +0 -141
- data/spec/mysql/migrate_/migrate_drop_index_with_alter_spec.rb +0 -141
- data/spec/processing_for_travis.rb +0 -11
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
describe 'Ridgepole::Client#diff -> migrate'
|
3
|
+
describe 'Ridgepole::Client#diff -> migrate' do
|
4
4
|
context 'with warning' do
|
5
5
|
let(:actual_dsl) do
|
6
6
|
erbh(<<-ERB)
|
@@ -68,7 +68,7 @@ describe 'Ridgepole::Client#diff -> migrate', condition: '>= 5.1.0' do
|
|
68
68
|
t.date "to_date", null: false
|
69
69
|
end
|
70
70
|
|
71
|
-
create_table "employees", id: :bigint, unsigned: true, force: :cascade do |t|
|
71
|
+
create_table "employees", <%= i cond(">= 6.1", { id: { type: :bigint, unsigned: true } }, { id: :bigint, unsigned: true }) %>, force: :cascade do |t|
|
72
72
|
t.integer "emp_no", null: false
|
73
73
|
t.date "birth_date", null: false
|
74
74
|
t.string "first_name", limit: 14, null: false
|
@@ -88,7 +88,7 @@ describe 'Ridgepole::Client#diff -> migrate', condition: '>= 5.1.0' do
|
|
88
88
|
t.date "to_date", null: false
|
89
89
|
end
|
90
90
|
|
91
|
-
create_table "employees", id: :bigint, unsigned: true, force: :cascade do |t|
|
91
|
+
create_table "employees", <%= i cond(">= 6.1", { id: { type: :bigint, unsigned: true } }, { id: :bigint, unsigned: true }) %>, force: :cascade do |t|
|
92
92
|
t.integer "emp_no", null: false
|
93
93
|
t.date "birth_date", null: false
|
94
94
|
t.string "first_name", limit: 14, null: false
|
@@ -179,7 +179,7 @@ describe 'Ridgepole::Client#diff -> migrate', condition: '>= 5.1.0' do
|
|
179
179
|
t.date "to_date", null: false
|
180
180
|
end
|
181
181
|
|
182
|
-
create_table "employees", id: :bigint, unsigned: true, force: :cascade do |t|
|
182
|
+
create_table "employees", <%= i cond(">= 6.1", { id: { type: :bigint, unsigned: true } }, { id: :bigint, unsigned: true }) %>, force: :cascade do |t|
|
183
183
|
t.integer "emp_no", null: false
|
184
184
|
t.date "birth_date", null: false
|
185
185
|
t.string "first_name", limit: 14, null: false
|
@@ -199,7 +199,7 @@ describe 'Ridgepole::Client#diff -> migrate', condition: '>= 5.1.0' do
|
|
199
199
|
t.date "to_date", null: false
|
200
200
|
end
|
201
201
|
|
202
|
-
create_table "employees", id: :bigint, unsigned: true, force: :cascade do |t|
|
202
|
+
create_table "employees", <%= i cond(">= 6.1", { id: { type: :bigint, unsigned: true } }, { id: :bigint, unsigned: true }) %>, force: :cascade do |t|
|
203
203
|
t.integer "emp_no", null: false
|
204
204
|
t.date "birth_date", null: false
|
205
205
|
t.string "first_name", limit: 14, null: false
|
@@ -6,12 +6,12 @@ describe 'Ridgepole::Client#diff -> migrate' do
|
|
6
6
|
erbh(<<-ERB)
|
7
7
|
create_table "clubs", force: :cascade do |t|
|
8
8
|
t.string "name", default: "", null: false
|
9
|
-
t.index ["name"], name: "idx_name", unique: true
|
9
|
+
t.index ["name"], name: "idx_name", unique: true
|
10
10
|
end
|
11
11
|
|
12
12
|
create_table "departments", primary_key: "dept_no", force: :cascade do |t|
|
13
13
|
t.string "dept_name", limit: 40, null: false
|
14
|
-
t.index ["dept_name"], name: "dept_name", unique: true
|
14
|
+
t.index ["dept_name"], name: "dept_name", unique: true
|
15
15
|
end
|
16
16
|
|
17
17
|
create_table "dept_emp", id: false, force: :cascade do |t|
|
@@ -19,8 +19,8 @@ describe 'Ridgepole::Client#diff -> migrate' do
|
|
19
19
|
t.string "dept_no", null: false
|
20
20
|
t.date "from_date", null: false
|
21
21
|
t.date "to_date", null: false
|
22
|
-
t.index ["dept_no"], name: "dept_no"
|
23
|
-
t.index ["emp_no"], name: "emp_no"
|
22
|
+
t.index ["dept_no"], name: "dept_no"
|
23
|
+
t.index ["emp_no"], name: "emp_no"
|
24
24
|
end
|
25
25
|
|
26
26
|
create_table "dept_manager", id: false, force: :cascade do |t|
|
@@ -28,14 +28,14 @@ describe 'Ridgepole::Client#diff -> migrate' do
|
|
28
28
|
t.integer "emp_no", null: false
|
29
29
|
t.date "from_date", null: false
|
30
30
|
t.date "to_date", null: false
|
31
|
-
t.index ["dept_no"], name: "dept_no"
|
32
|
-
t.index ["emp_no"], name: "emp_no"
|
31
|
+
t.index ["dept_no"], name: "dept_no"
|
32
|
+
t.index ["emp_no"], name: "emp_no"
|
33
33
|
end
|
34
34
|
|
35
35
|
create_table "employee_clubs", force: :cascade do |t|
|
36
36
|
t.integer "emp_no", null: false
|
37
37
|
t.integer "club_id", null: false
|
38
|
-
t.index ["emp_no", "club_id"], name: "idx_emp_no_club_id"
|
38
|
+
t.index ["emp_no", "club_id"], name: "idx_emp_no_club_id"
|
39
39
|
end
|
40
40
|
|
41
41
|
create_table "employees", primary_key: "emp_no", force: :cascade do |t|
|
@@ -51,7 +51,7 @@ describe 'Ridgepole::Client#diff -> migrate' do
|
|
51
51
|
t.integer "salary", null: false
|
52
52
|
t.date "from_date", null: false
|
53
53
|
t.date "to_date", null: false
|
54
|
-
t.index ["emp_no"], name: "emp_no"
|
54
|
+
t.index ["emp_no"], name: "emp_no"
|
55
55
|
end
|
56
56
|
|
57
57
|
create_table "titles", id: false, force: :cascade do |t|
|
@@ -59,7 +59,7 @@ describe 'Ridgepole::Client#diff -> migrate' do
|
|
59
59
|
t.string "title", limit: 50, null: false
|
60
60
|
t.date "from_date", null: false
|
61
61
|
t.date "to_date"
|
62
|
-
t.index ["emp_no"], name: "emp_no"
|
62
|
+
t.index ["emp_no"], name: "emp_no"
|
63
63
|
end
|
64
64
|
ERB
|
65
65
|
end
|
@@ -72,7 +72,7 @@ describe 'Ridgepole::Client#diff -> migrate' do
|
|
72
72
|
|
73
73
|
create_table "departments", primary_key: "dept_no", force: :cascade do |t|
|
74
74
|
t.string "dept_name", limit: 40, null: false
|
75
|
-
t.index ["dept_name"], name: "dept_name", unique: true
|
75
|
+
t.index ["dept_name"], name: "dept_name", unique: true
|
76
76
|
end
|
77
77
|
|
78
78
|
create_table "dept_emp", id: false, force: :cascade do |t|
|
@@ -80,8 +80,8 @@ describe 'Ridgepole::Client#diff -> migrate' do
|
|
80
80
|
t.string "dept_no", null: false
|
81
81
|
t.date "from_date", null: false
|
82
82
|
t.date "to_date", null: false
|
83
|
-
t.index ["dept_no"], name: "dept_no"
|
84
|
-
t.index ["emp_no"], name: "emp_no"
|
83
|
+
t.index ["dept_no"], name: "dept_no"
|
84
|
+
t.index ["emp_no"], name: "emp_no"
|
85
85
|
end
|
86
86
|
|
87
87
|
create_table "dept_manager", id: false, force: :cascade do |t|
|
@@ -89,8 +89,8 @@ describe 'Ridgepole::Client#diff -> migrate' do
|
|
89
89
|
t.integer "emp_no", null: false
|
90
90
|
t.date "from_date", null: false
|
91
91
|
t.date "to_date", null: false
|
92
|
-
t.index ["dept_no"], name: "dept_no"
|
93
|
-
t.index ["emp_no"], name: "emp_no"
|
92
|
+
t.index ["dept_no"], name: "dept_no"
|
93
|
+
t.index ["emp_no"], name: "emp_no"
|
94
94
|
end
|
95
95
|
|
96
96
|
create_table "employee_clubs", force: :cascade do |t|
|
@@ -111,7 +111,7 @@ describe 'Ridgepole::Client#diff -> migrate' do
|
|
111
111
|
t.integer "salary", null: false
|
112
112
|
t.date "from_date", null: false
|
113
113
|
t.date "to_date", null: false
|
114
|
-
t.index ["emp_no"], name: "emp_no"
|
114
|
+
t.index ["emp_no"], name: "emp_no"
|
115
115
|
end
|
116
116
|
|
117
117
|
create_table "titles", id: false, force: :cascade do |t|
|
@@ -127,14 +127,14 @@ describe 'Ridgepole::Client#diff -> migrate' do
|
|
127
127
|
erbh(<<-ERB)
|
128
128
|
create_table "clubs", force: :cascade do |t|
|
129
129
|
t.string "name", limit: 255, default: "", null: false
|
130
|
-
t.index ["name"], name: "idx_name", unique: true
|
130
|
+
t.index ["name"], name: "idx_name", unique: true
|
131
131
|
end
|
132
132
|
|
133
133
|
create_table "departments", primary_key: "dept_no", force: :cascade do |t|
|
134
134
|
t.string "dept_name", limit: 40, null: false
|
135
135
|
end
|
136
136
|
|
137
|
-
add_index "departments", ["dept_name"], name: "dept_name", unique: true
|
137
|
+
add_index "departments", ["dept_name"], name: "dept_name", unique: true
|
138
138
|
|
139
139
|
create_table "dept_emp", id: false, force: :cascade do |t|
|
140
140
|
t.integer "emp_no", null: false
|
@@ -143,8 +143,8 @@ describe 'Ridgepole::Client#diff -> migrate' do
|
|
143
143
|
t.date "to_date", null: false
|
144
144
|
end
|
145
145
|
|
146
|
-
add_index "dept_emp", ["dept_no"], name: "dept_no"
|
147
|
-
add_index "dept_emp", ["emp_no"], name: "emp_no"
|
146
|
+
add_index "dept_emp", ["dept_no"], name: "dept_no"
|
147
|
+
add_index "dept_emp", ["emp_no"], name: "emp_no"
|
148
148
|
|
149
149
|
create_table "dept_manager", id: false, force: :cascade do |t|
|
150
150
|
t.string "dept_no", null: false
|
@@ -153,13 +153,13 @@ describe 'Ridgepole::Client#diff -> migrate' do
|
|
153
153
|
t.date "to_date", null: false
|
154
154
|
end
|
155
155
|
|
156
|
-
add_index "dept_manager", ["dept_no"], name: "dept_no"
|
157
|
-
add_index "dept_manager", ["emp_no"], name: "emp_no"
|
156
|
+
add_index "dept_manager", ["dept_no"], name: "dept_no"
|
157
|
+
add_index "dept_manager", ["emp_no"], name: "emp_no"
|
158
158
|
|
159
159
|
create_table "employee_clubs", force: :cascade do |t|
|
160
160
|
t.integer "emp_no", null: false
|
161
161
|
t.integer "club_id", null: false
|
162
|
-
t.index ["emp_no", "club_id"], name: "idx_emp_no_club_id"
|
162
|
+
t.index ["emp_no", "club_id"], name: "idx_emp_no_club_id"
|
163
163
|
end
|
164
164
|
|
165
165
|
create_table "employees", primary_key: "emp_no", force: :cascade do |t|
|
@@ -177,14 +177,14 @@ describe 'Ridgepole::Client#diff -> migrate' do
|
|
177
177
|
t.date "to_date", null: false
|
178
178
|
end
|
179
179
|
|
180
|
-
add_index "salaries", ["emp_no"], name: "emp_no"
|
180
|
+
add_index "salaries", ["emp_no"], name: "emp_no"
|
181
181
|
|
182
182
|
create_table "titles", id: false, force: :cascade do |t|
|
183
183
|
t.integer "emp_no", null: false
|
184
184
|
t.string "title", limit: 50, null: false
|
185
185
|
t.date "from_date", null: false
|
186
186
|
t.date "to_date"
|
187
|
-
t.index ["emp_no"], name: "emp_no"
|
187
|
+
t.index ["emp_no"], name: "emp_no"
|
188
188
|
end
|
189
189
|
ERB
|
190
190
|
end
|
@@ -6,12 +6,12 @@ describe 'Ridgepole::Client#diff -> migrate' do
|
|
6
6
|
erbh(<<-ERB)
|
7
7
|
create_table "clubs", force: :cascade do |t|
|
8
8
|
t.string "name", default: "", null: false
|
9
|
-
t.index ["name"], name: "idx_name", unique: true
|
9
|
+
t.index ["name"], name: "idx_name", unique: true
|
10
10
|
end
|
11
11
|
|
12
12
|
create_table "departments", primary_key: "dept_no", force: :cascade do |t|
|
13
13
|
t.string "dept_name", limit: 40, null: false
|
14
|
-
t.index ["dept_name"], name: "dept_name", unique: true
|
14
|
+
t.index ["dept_name"], name: "dept_name", unique: true
|
15
15
|
end
|
16
16
|
|
17
17
|
create_table "dept_emp", id: false, force: :cascade do |t|
|
@@ -19,8 +19,8 @@ describe 'Ridgepole::Client#diff -> migrate' do
|
|
19
19
|
t.string "dept_no", null: false
|
20
20
|
t.date "from_date", null: false
|
21
21
|
t.date "to_date", null: false
|
22
|
-
t.index ["dept_no"], name: "dept_no"
|
23
|
-
t.index ["emp_no"], name: "emp_no"
|
22
|
+
t.index ["dept_no"], name: "dept_no"
|
23
|
+
t.index ["emp_no"], name: "emp_no"
|
24
24
|
end
|
25
25
|
|
26
26
|
create_table "dept_manager", id: false, force: :cascade do |t|
|
@@ -28,14 +28,14 @@ describe 'Ridgepole::Client#diff -> migrate' do
|
|
28
28
|
t.integer "emp_no", null: false
|
29
29
|
t.date "from_date", null: false
|
30
30
|
t.date "to_date", null: false
|
31
|
-
t.index ["dept_no"], name: "dept_no"
|
32
|
-
t.index ["emp_no"], name: "emp_no"
|
31
|
+
t.index ["dept_no"], name: "dept_no"
|
32
|
+
t.index ["emp_no"], name: "emp_no"
|
33
33
|
end
|
34
34
|
|
35
35
|
create_table "employee_clubs", force: :cascade do |t|
|
36
36
|
t.integer "emp_no", null: false
|
37
37
|
t.integer "club_id", null: false
|
38
|
-
t.index ["emp_no", "club_id"], name: "idx_emp_no_club_id"
|
38
|
+
t.index ["emp_no", "club_id"], name: "idx_emp_no_club_id"
|
39
39
|
end
|
40
40
|
|
41
41
|
create_table "employees", primary_key: "emp_no", force: :cascade do |t|
|
@@ -51,7 +51,7 @@ describe 'Ridgepole::Client#diff -> migrate' do
|
|
51
51
|
t.integer "salary", null: false
|
52
52
|
t.date "from_date", null: false
|
53
53
|
t.date "to_date", null: false
|
54
|
-
t.index ["emp_no"], name: "emp_no"
|
54
|
+
t.index ["emp_no"], name: "emp_no"
|
55
55
|
end
|
56
56
|
|
57
57
|
create_table "titles", id: false, force: :cascade do |t|
|
@@ -59,7 +59,7 @@ describe 'Ridgepole::Client#diff -> migrate' do
|
|
59
59
|
t.string "title", limit: 50, null: false
|
60
60
|
t.date "from_date", null: false
|
61
61
|
t.date "to_date"
|
62
|
-
t.index ["emp_no"], name: "emp_no"
|
62
|
+
t.index ["emp_no"], name: "emp_no"
|
63
63
|
end
|
64
64
|
ERB
|
65
65
|
end
|
@@ -72,7 +72,7 @@ describe 'Ridgepole::Client#diff -> migrate' do
|
|
72
72
|
|
73
73
|
create_table "departments", primary_key: "dept_no", force: :cascade do |t|
|
74
74
|
t.string "dept_name", limit: 40, null: false
|
75
|
-
t.index ["dept_name"], name: "dept_name", unique: true
|
75
|
+
t.index ["dept_name"], name: "dept_name", unique: true
|
76
76
|
end
|
77
77
|
|
78
78
|
create_table "dept_emp", id: false, force: :cascade do |t|
|
@@ -80,8 +80,8 @@ describe 'Ridgepole::Client#diff -> migrate' do
|
|
80
80
|
t.string "dept_no", null: false
|
81
81
|
t.date "from_date", null: false
|
82
82
|
t.date "to_date", null: false
|
83
|
-
t.index ["dept_no"], name: "dept_no"
|
84
|
-
t.index ["emp_no"], name: "emp_no"
|
83
|
+
t.index ["dept_no"], name: "dept_no"
|
84
|
+
t.index ["emp_no"], name: "emp_no"
|
85
85
|
end
|
86
86
|
|
87
87
|
create_table "dept_manager", id: false, force: :cascade do |t|
|
@@ -89,8 +89,8 @@ describe 'Ridgepole::Client#diff -> migrate' do
|
|
89
89
|
t.integer "emp_no", null: false
|
90
90
|
t.date "from_date", null: false
|
91
91
|
t.date "to_date", null: false
|
92
|
-
t.index ["dept_no"], name: "dept_no"
|
93
|
-
t.index ["emp_no"], name: "emp_no"
|
92
|
+
t.index ["dept_no"], name: "dept_no"
|
93
|
+
t.index ["emp_no"], name: "emp_no"
|
94
94
|
end
|
95
95
|
|
96
96
|
create_table "employee_clubs", force: :cascade do |t|
|
@@ -111,7 +111,7 @@ describe 'Ridgepole::Client#diff -> migrate' do
|
|
111
111
|
t.integer "salary", null: false
|
112
112
|
t.date "from_date", null: false
|
113
113
|
t.date "to_date", null: false
|
114
|
-
t.index ["emp_no"], name: "emp_no"
|
114
|
+
t.index ["emp_no"], name: "emp_no"
|
115
115
|
end
|
116
116
|
|
117
117
|
create_table "titles", id: false, force: :cascade do |t|
|
@@ -142,15 +142,15 @@ describe 'Ridgepole::Client#diff -> migrate' do
|
|
142
142
|
expect(subject.dump).to match_ruby actual_dsl
|
143
143
|
expect(delta.script).to match_fuzzy erbh(<<-ERB)
|
144
144
|
change_table("clubs", bulk: true) do |t|
|
145
|
-
t.index(["name"],
|
145
|
+
t.index(["name"], **{:name=>"idx_name", :unique=>true})
|
146
146
|
end
|
147
147
|
|
148
148
|
change_table("employee_clubs", bulk: true) do |t|
|
149
|
-
t.index(["emp_no", "club_id"],
|
149
|
+
t.index(["emp_no", "club_id"], **{:name=>"idx_emp_no_club_id"})
|
150
150
|
end
|
151
151
|
|
152
152
|
change_table("titles", bulk: true) do |t|
|
153
|
-
t.index(["emp_no"],
|
153
|
+
t.index(["emp_no"], **{:name=>"emp_no"})
|
154
154
|
end
|
155
155
|
ERB
|
156
156
|
delta.migrate
|
@@ -6,12 +6,12 @@ describe 'Ridgepole::Client#diff -> migrate' do
|
|
6
6
|
erbh(<<-ERB)
|
7
7
|
create_table "clubs", force: :cascade do |t|
|
8
8
|
t.string "name", default: "", null: false
|
9
|
-
t.index ["name"], name: "idx_name", unique: true
|
9
|
+
t.index ["name"], name: "idx_name", unique: true
|
10
10
|
end
|
11
11
|
|
12
12
|
create_table "departments", primary_key: "dept_no", force: :cascade do |t|
|
13
13
|
t.string "dept_name", limit: 40, null: false
|
14
|
-
t.index ["dept_name"], name: "dept_name", unique: true
|
14
|
+
t.index ["dept_name"], name: "dept_name", unique: true
|
15
15
|
end
|
16
16
|
|
17
17
|
create_table "dept_emp", primary_key: ["emp_no", "dept_no"], force: :cascade do |t|
|
@@ -19,8 +19,8 @@ describe 'Ridgepole::Client#diff -> migrate' do
|
|
19
19
|
t.string "dept_no", null: false
|
20
20
|
t.date "from_date", null: false
|
21
21
|
t.date "to_date", null: false
|
22
|
-
t.index ["dept_no"], name: "dept_no"
|
23
|
-
t.index ["emp_no"], name: "emp_no"
|
22
|
+
t.index ["dept_no"], name: "dept_no"
|
23
|
+
t.index ["emp_no"], name: "emp_no"
|
24
24
|
end
|
25
25
|
|
26
26
|
create_table "dept_manager", primary_key: ["emp_no", "dept_no"], force: :cascade do |t|
|
@@ -28,14 +28,14 @@ describe 'Ridgepole::Client#diff -> migrate' do
|
|
28
28
|
t.integer "emp_no", null: false
|
29
29
|
t.date "from_date", null: false
|
30
30
|
t.date "to_date", null: false
|
31
|
-
t.index ["dept_no"], name: "dept_no"
|
32
|
-
t.index ["emp_no"], name: "emp_no"
|
31
|
+
t.index ["dept_no"], name: "dept_no"
|
32
|
+
t.index ["emp_no"], name: "emp_no"
|
33
33
|
end
|
34
34
|
|
35
35
|
create_table "employee_clubs", force: :cascade do |t|
|
36
36
|
t.integer "emp_no", null: false
|
37
37
|
t.integer "club_id", null: false
|
38
|
-
t.index ["emp_no", "club_id"], name: "idx_emp_no_club_id"
|
38
|
+
t.index ["emp_no", "club_id"], name: "idx_emp_no_club_id"
|
39
39
|
end
|
40
40
|
|
41
41
|
create_table "employees", primary_key: "emp_no", force: :cascade do |t|
|
@@ -51,7 +51,7 @@ describe 'Ridgepole::Client#diff -> migrate' do
|
|
51
51
|
t.integer "salary", null: false
|
52
52
|
t.date "from_date", null: false
|
53
53
|
t.date "to_date", null: false
|
54
|
-
t.index ["emp_no"], name: "emp_no"
|
54
|
+
t.index ["emp_no"], name: "emp_no"
|
55
55
|
end
|
56
56
|
|
57
57
|
create_table "titles", primary_key: ["emp_no", "title", "from_date"], force: :cascade do |t|
|
@@ -59,7 +59,7 @@ describe 'Ridgepole::Client#diff -> migrate' do
|
|
59
59
|
t.string "title", limit: 50, null: false
|
60
60
|
t.date "from_date", null: false
|
61
61
|
t.date "to_date"
|
62
|
-
t.index ["emp_no"], name: "emp_no"
|
62
|
+
t.index ["emp_no"], name: "emp_no"
|
63
63
|
end
|
64
64
|
ERB
|
65
65
|
end
|
@@ -68,7 +68,7 @@ describe 'Ridgepole::Client#diff -> migrate' do
|
|
68
68
|
erbh(<<-ERB)
|
69
69
|
create_table "departments", primary_key: "dept_no", force: :cascade do |t|
|
70
70
|
t.string "dept_name", limit: 40, null: false
|
71
|
-
t.index ["dept_name"], name: "dept_name", unique: true
|
71
|
+
t.index ["dept_name"], name: "dept_name", unique: true
|
72
72
|
end
|
73
73
|
|
74
74
|
create_table "dept_emp", primary_key: ["emp_no", "dept_no"], force: :cascade do |t|
|
@@ -76,8 +76,8 @@ describe 'Ridgepole::Client#diff -> migrate' do
|
|
76
76
|
t.string "dept_no", null: false
|
77
77
|
t.date "from_date", null: false
|
78
78
|
t.date "to_date", null: false
|
79
|
-
t.index ["dept_no"], name: "dept_no"
|
80
|
-
t.index ["emp_no"], name: "emp_no"
|
79
|
+
t.index ["dept_no"], name: "dept_no"
|
80
|
+
t.index ["emp_no"], name: "emp_no"
|
81
81
|
end
|
82
82
|
|
83
83
|
create_table "dept_manager", primary_key: ["emp_no", "dept_no"], force: :cascade do |t|
|
@@ -85,8 +85,8 @@ describe 'Ridgepole::Client#diff -> migrate' do
|
|
85
85
|
t.integer "emp_no", null: false
|
86
86
|
t.date "from_date", null: false
|
87
87
|
t.date "to_date", null: false
|
88
|
-
t.index ["dept_no"], name: "dept_no"
|
89
|
-
t.index ["emp_no"], name: "emp_no"
|
88
|
+
t.index ["dept_no"], name: "dept_no"
|
89
|
+
t.index ["emp_no"], name: "emp_no"
|
90
90
|
end
|
91
91
|
|
92
92
|
create_table "salaries", primary_key: ["emp_no", "from_date"], force: :cascade do |t|
|
@@ -94,7 +94,7 @@ describe 'Ridgepole::Client#diff -> migrate' do
|
|
94
94
|
t.integer "salary", null: false
|
95
95
|
t.date "from_date", null: false
|
96
96
|
t.date "to_date", null: false
|
97
|
-
t.index ["emp_no"], name: "emp_no"
|
97
|
+
t.index ["emp_no"], name: "emp_no"
|
98
98
|
end
|
99
99
|
|
100
100
|
create_table "titles", primary_key: ["emp_no", "title", "from_date"], force: :cascade do |t|
|
@@ -102,7 +102,7 @@ describe 'Ridgepole::Client#diff -> migrate' do
|
|
102
102
|
t.string "title", limit: 50, null: false
|
103
103
|
t.date "from_date", null: false
|
104
104
|
t.date "to_date"
|
105
|
-
t.index ["emp_no"], name: "emp_no"
|
105
|
+
t.index ["emp_no"], name: "emp_no"
|
106
106
|
end
|
107
107
|
ERB
|
108
108
|
end
|
@@ -6,7 +6,7 @@ describe 'Ridgepole::Client#diff -> migrate' do
|
|
6
6
|
erbh(<<-ERB)
|
7
7
|
create_table "departments", primary_key: "dept_no", force: :cascade do |t|
|
8
8
|
t.string "dept_name", limit: 40, null: false
|
9
|
-
t.index ["dept_name"], name: "dept_name", unique: true
|
9
|
+
t.index ["dept_name"], name: "dept_name", unique: true
|
10
10
|
end
|
11
11
|
|
12
12
|
create_table "dept_emp", primary_key: ["emp_no", "dept_no"], force: :cascade do |t|
|
@@ -14,8 +14,8 @@ describe 'Ridgepole::Client#diff -> migrate' do
|
|
14
14
|
t.string "dept_no", null: false
|
15
15
|
t.date "from_date", null: false, ignore: true
|
16
16
|
t.date "to_date", null: false
|
17
|
-
t.index ["dept_no"], name: "dept_no",
|
18
|
-
t.index ["emp_no"], name: "emp_no"
|
17
|
+
t.index ["dept_no"], name: "dept_no", ignore: true
|
18
|
+
t.index ["emp_no"], name: "emp_no"
|
19
19
|
end
|
20
20
|
ERB
|
21
21
|
end
|
@@ -24,7 +24,7 @@ describe 'Ridgepole::Client#diff -> migrate' do
|
|
24
24
|
erbh(<<-ERB)
|
25
25
|
create_table "departments", primary_key: "dept_no", force: :cascade do |t|
|
26
26
|
t.string "dept_name", limit: 40, null: false
|
27
|
-
t.index ["dept_name"], name: "dept_name", unique: true
|
27
|
+
t.index ["dept_name"], name: "dept_name", unique: true
|
28
28
|
end
|
29
29
|
ERB
|
30
30
|
end
|