ridgepole 0.9.0.beta → 0.9.0.rc1
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 +19 -1
- data/.simplecov +6 -0
- data/README.md +4 -26
- data/bin/ridgepole +0 -2
- data/lib/ridgepole/diff.rb +7 -11
- data/lib/ridgepole/dsl_parser/table_definition.rb +1 -1
- data/lib/ridgepole/version.rb +1 -1
- data/ridgepole.gemspec +2 -1
- data/spec/erb_helper.rb +1 -5
- data/spec/mysql/bigint_pk/int_pk_spec.rb +1 -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 +12 -12
- data/spec/mysql/dump/dump_some_tables_spec.rb +4 -4
- data/spec/mysql/dump/dump_spec.rb +12 -12
- data/spec/mysql/dump/dump_unknown_column_type_spec.rb +2 -2
- data/spec/mysql/dump/dump_without_table_options_spec.rb +1 -1
- data/spec/mysql/fk/migrate_change_fk2_spec.rb +2 -2
- data/spec/mysql/fk/migrate_change_fk_spec.rb +20 -20
- data/spec/mysql/fk/migrate_create_fk_spec.rb +18 -18
- data/spec/mysql/fk/migrate_drop_fk_spec.rb +26 -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 +21 -21
- 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_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 +27 -27
- data/spec/mysql/migrate/migrate_check_relation_column_type_spec.rb +1 -1
- 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 +1 -1
- 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 +12 -12
- 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 +1 -1
- 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 +12 -12
- 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 +16 -16
- data/spec/postgresql/migrate/migrate_add_expression_index_spec.rb +1 -1
- data/spec/postgresql/migrate/migrate_change_column_spec.rb +16 -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 +18 -18
- 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 +12 -12
- 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_helper.rb +1 -1
- metadata +33 -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/processing_for_travis.rb +0 -11
@@ -4,16 +4,16 @@ describe 'Ridgepole::Client#diff -> migrate' do
|
|
4
4
|
context 'when create fk with column' do
|
5
5
|
let(:actual_dsl) do
|
6
6
|
erbh(<<-ERB)
|
7
|
-
create_table "direct_messages",
|
7
|
+
create_table "direct_messages", id: :integer, force: :cascade do |t|
|
8
8
|
t.integer "sender_id"
|
9
9
|
t.integer "reciever_id"
|
10
10
|
t.datetime "created_at", null: false
|
11
11
|
t.datetime "updated_at", null: false
|
12
|
-
t.index ["reciever_id"], name: "index_direct_messages_on_reciever_id"
|
13
|
-
t.index ["sender_id"], name: "index_direct_messages_on_sender_id"
|
12
|
+
t.index ["reciever_id"], name: "index_direct_messages_on_reciever_id"
|
13
|
+
t.index ["sender_id"], name: "index_direct_messages_on_sender_id"
|
14
14
|
end
|
15
15
|
|
16
|
-
create_table "users",
|
16
|
+
create_table "users", id: :integer, force: :cascade do |t|
|
17
17
|
t.string "email"
|
18
18
|
t.datetime "created_at", null: false
|
19
19
|
t.datetime "updated_at", null: false
|
@@ -62,16 +62,16 @@ describe 'Ridgepole::Client#diff -> migrate' do
|
|
62
62
|
|
63
63
|
let(:expected_dsl) do
|
64
64
|
erbh(<<-ERB)
|
65
|
-
create_table "direct_messages",
|
65
|
+
create_table "direct_messages", id: :integer, force: :cascade do |t|
|
66
66
|
t.integer "sender_id"
|
67
67
|
t.integer "reciever_id"
|
68
68
|
t.datetime "created_at", null: false
|
69
69
|
t.datetime "updated_at", null: false
|
70
|
-
t.index ["reciever_id"], name: "index_direct_messages_on_reciever_id"
|
71
|
-
t.index ["sender_id"], name: "index_direct_messages_on_sender_id"
|
70
|
+
t.index ["reciever_id"], name: "index_direct_messages_on_reciever_id"
|
71
|
+
t.index ["sender_id"], name: "index_direct_messages_on_sender_id"
|
72
72
|
end
|
73
73
|
|
74
|
-
create_table "users",
|
74
|
+
create_table "users", id: :integer, force: :cascade do |t|
|
75
75
|
t.string "email"
|
76
76
|
t.datetime "created_at", null: false
|
77
77
|
t.datetime "updated_at", null: false
|
@@ -106,16 +106,16 @@ describe 'Ridgepole::Client#diff -> migrate' do
|
|
106
106
|
context 'when change fk with column' do
|
107
107
|
let(:actual_dsl) do
|
108
108
|
erbh(<<-ERB)
|
109
|
-
create_table "direct_messages",
|
109
|
+
create_table "direct_messages", id: :integer, force: :cascade do |t|
|
110
110
|
t.integer "sender_id"
|
111
111
|
t.integer "reciever_id"
|
112
112
|
t.datetime "created_at", null: false
|
113
113
|
t.datetime "updated_at", null: false
|
114
|
-
t.index ["reciever_id"], name: "index_direct_messages_on_reciever_id"
|
115
|
-
t.index ["sender_id"], name: "index_direct_messages_on_sender_id"
|
114
|
+
t.index ["reciever_id"], name: "index_direct_messages_on_reciever_id"
|
115
|
+
t.index ["sender_id"], name: "index_direct_messages_on_sender_id"
|
116
116
|
end
|
117
117
|
|
118
|
-
create_table "users",
|
118
|
+
create_table "users", id: :integer, force: :cascade do |t|
|
119
119
|
t.string "email"
|
120
120
|
t.datetime "created_at", null: false
|
121
121
|
t.datetime "updated_at", null: false
|
@@ -128,16 +128,16 @@ describe 'Ridgepole::Client#diff -> migrate' do
|
|
128
128
|
|
129
129
|
let(:expected_dsl) do
|
130
130
|
erbh(<<-ERB)
|
131
|
-
create_table "direct_messages",
|
131
|
+
create_table "direct_messages", id: :integer, force: :cascade do |t|
|
132
132
|
t.integer "sender_id"
|
133
133
|
t.integer "reciever_id"
|
134
134
|
t.datetime "created_at", null: false
|
135
135
|
t.datetime "updated_at", null: false
|
136
|
-
t.index ["reciever_id"], name: "index_direct_messages_on_reciever_id"
|
137
|
-
t.index ["sender_id"], name: "index_direct_messages_on_sender_id"
|
136
|
+
t.index ["reciever_id"], name: "index_direct_messages_on_reciever_id"
|
137
|
+
t.index ["sender_id"], name: "index_direct_messages_on_sender_id"
|
138
138
|
end
|
139
139
|
|
140
|
-
create_table "users",
|
140
|
+
create_table "users", id: :integer, force: :cascade do |t|
|
141
141
|
t.string "email"
|
142
142
|
t.datetime "created_at", null: false
|
143
143
|
t.datetime "updated_at", null: false
|
@@ -6,10 +6,10 @@ describe 'Ridgepole::Client#diff -> migrate' do
|
|
6
6
|
erbh(<<-ERB)
|
7
7
|
create_table "child", force: :cascade do |t|
|
8
8
|
t.integer "parent_id"
|
9
|
-
t.index ["parent_id"], name: "par_id"
|
9
|
+
t.index ["parent_id"], name: "par_id"
|
10
10
|
end
|
11
11
|
|
12
|
-
create_table "parent",
|
12
|
+
create_table "parent", id: :integer, force: :cascade do |t|
|
13
13
|
end
|
14
14
|
ERB
|
15
15
|
end
|
@@ -32,12 +32,12 @@ describe 'Ridgepole::Client#diff -> migrate' do
|
|
32
32
|
context 'when change fk with ignore:true' do
|
33
33
|
let(:actual_dsl) do
|
34
34
|
erbh(<<-ERB)
|
35
|
-
create_table "parent",
|
35
|
+
create_table "parent", id: :integer, force: :cascade do |t|
|
36
36
|
end
|
37
37
|
|
38
38
|
create_table "child", force: :cascade do |t|
|
39
39
|
t.integer "parent_id"
|
40
|
-
t.index ["parent_id"], name: "par_id"
|
40
|
+
t.index ["parent_id"], name: "par_id"
|
41
41
|
end
|
42
42
|
|
43
43
|
add_foreign_key "child", "parent", name: "child_ibfk_1", on_delete: :cascade
|
@@ -48,10 +48,10 @@ describe 'Ridgepole::Client#diff -> migrate' do
|
|
48
48
|
erbh(<<-ERB)
|
49
49
|
create_table "child", force: :cascade do |t|
|
50
50
|
t.integer "parent_id"
|
51
|
-
t.index ["parent_id"], name: "par_id"
|
51
|
+
t.index ["parent_id"], name: "par_id"
|
52
52
|
end
|
53
53
|
|
54
|
-
create_table "parent",
|
54
|
+
create_table "parent", id: :integer, force: :cascade do |t|
|
55
55
|
end
|
56
56
|
|
57
57
|
add_foreign_key "child", "parent", name: "child_ibfk_1", ignore: true
|
@@ -37,7 +37,7 @@ describe 'Ridgepole::Client#diff -> migrate' do
|
|
37
37
|
|
38
38
|
expect(show_create_table_mysql('dept_emp')).to match_fuzzy erbh(<<-ERB)
|
39
39
|
CREATE TABLE `dept_emp` (
|
40
|
-
`id`
|
40
|
+
`id` bigint(20) NOT NULL AUTO_INCREMENT,
|
41
41
|
`emp_no0` int(11) NOT NULL,
|
42
42
|
`emp_no` int(11) NOT NULL,
|
43
43
|
`dept_no` varchar(4) NOT NULL,
|
@@ -129,7 +129,7 @@ describe 'Ridgepole::Client#diff -> migrate' do
|
|
129
129
|
|
130
130
|
expect(show_create_table_mysql('dept_emp')).to match_fuzzy erbh(<<-ERB)
|
131
131
|
CREATE TABLE `dept_emp` (
|
132
|
-
`emp_no`
|
132
|
+
`emp_no` bigint(20) NOT NULL AUTO_INCREMENT,
|
133
133
|
`emp_no0` int(11) NOT NULL,
|
134
134
|
`dept_no` varchar(4) NOT NULL,
|
135
135
|
`from_date` date NOT NULL,
|
@@ -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", limit: 4, 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
|
@@ -68,12 +68,12 @@ describe 'Ridgepole::Client#diff -> migrate' do
|
|
68
68
|
erbh(<<-ERB)
|
69
69
|
create_table "clubs", force: :cascade do |t|
|
70
70
|
t.string "name", default: "", null: false
|
71
|
-
t.index ["name"], name: "idx_name", unique: true
|
71
|
+
t.index ["name"], name: "idx_name", unique: true
|
72
72
|
end
|
73
73
|
|
74
74
|
create_table "departments", primary_key: "dept_no", force: :cascade do |t|
|
75
75
|
t.string "dept_name", limit: 40, null: false
|
76
|
-
t.index ["dept_name"], name: "dept_name", unique: true
|
76
|
+
t.index ["dept_name"], name: "dept_name", unique: true
|
77
77
|
end
|
78
78
|
|
79
79
|
create_table "dept_emp", id: false, force: :cascade do |t|
|
@@ -81,8 +81,8 @@ describe 'Ridgepole::Client#diff -> migrate' do
|
|
81
81
|
t.string "dept_no", limit: 4, null: false
|
82
82
|
t.date "from_date", null: false
|
83
83
|
t.date "to_date", null: false
|
84
|
-
t.index ["dept_no"], name: "dept_no"
|
85
|
-
t.index ["emp_no"], name: "emp_no"
|
84
|
+
t.index ["dept_no"], name: "dept_no"
|
85
|
+
t.index ["emp_no"], name: "emp_no"
|
86
86
|
end
|
87
87
|
|
88
88
|
create_table "dept_manager", id: false, force: :cascade do |t|
|
@@ -90,15 +90,15 @@ describe 'Ridgepole::Client#diff -> migrate' do
|
|
90
90
|
t.integer "emp_no", null: false
|
91
91
|
t.date "from_date", null: false
|
92
92
|
t.date "to_date", null: false
|
93
|
-
t.index ["dept_no"], name: "dept_no"
|
94
|
-
t.index ["emp_no"], name: "emp_no"
|
93
|
+
t.index ["dept_no"], name: "dept_no"
|
94
|
+
t.index ["emp_no"], name: "emp_no"
|
95
95
|
end
|
96
96
|
|
97
97
|
create_table "employee_clubs", force: :cascade do |t|
|
98
98
|
t.integer "emp_no", null: false
|
99
99
|
t.integer "club_id", null: false
|
100
100
|
t.string "any_col", null: false
|
101
|
-
t.index ["emp_no", "club_id"], name: "idx_emp_no_club_id"
|
101
|
+
t.index ["emp_no", "club_id"], name: "idx_emp_no_club_id"
|
102
102
|
end
|
103
103
|
|
104
104
|
create_table "employees", primary_key: "emp_no", force: :cascade do |t|
|
@@ -116,7 +116,7 @@ describe 'Ridgepole::Client#diff -> migrate' do
|
|
116
116
|
t.integer "salary", null: false
|
117
117
|
t.date "from_date", null: false
|
118
118
|
t.date "to_date", null: false
|
119
|
-
t.index ["emp_no"], name: "emp_no"
|
119
|
+
t.index ["emp_no"], name: "emp_no"
|
120
120
|
end
|
121
121
|
|
122
122
|
create_table "titles", id: false, force: :cascade do |t|
|
@@ -124,7 +124,7 @@ describe 'Ridgepole::Client#diff -> migrate' do
|
|
124
124
|
t.string "title", limit: 50, null: false
|
125
125
|
t.date "from_date", null: false
|
126
126
|
t.date "to_date"
|
127
|
-
t.index ["emp_no"], name: "emp_no"
|
127
|
+
t.index ["emp_no"], name: "emp_no"
|
128
128
|
end
|
129
129
|
ERB
|
130
130
|
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", limit: 4, 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
|
@@ -68,12 +68,12 @@ describe 'Ridgepole::Client#diff -> migrate' do
|
|
68
68
|
erbh(<<-ERB)
|
69
69
|
create_table "clubs", force: :cascade do |t|
|
70
70
|
t.string "name", default: "", null: false
|
71
|
-
t.index ["name"], name: "idx_name", unique: true
|
71
|
+
t.index ["name"], name: "idx_name", unique: true
|
72
72
|
end
|
73
73
|
|
74
74
|
create_table "departments", primary_key: "dept_no", force: :cascade do |t|
|
75
75
|
t.string "dept_name", limit: 40, null: false
|
76
|
-
t.index ["dept_name"], name: "dept_name", unique: true
|
76
|
+
t.index ["dept_name"], name: "dept_name", unique: true
|
77
77
|
end
|
78
78
|
|
79
79
|
create_table "dept_emp", id: false, force: :cascade do |t|
|
@@ -81,8 +81,8 @@ describe 'Ridgepole::Client#diff -> migrate' do
|
|
81
81
|
t.string "dept_no", limit: 4, null: false
|
82
82
|
t.date "from_date", null: false
|
83
83
|
t.date "to_date", null: false
|
84
|
-
t.index ["dept_no"], name: "dept_no"
|
85
|
-
t.index ["emp_no"], name: "emp_no"
|
84
|
+
t.index ["dept_no"], name: "dept_no"
|
85
|
+
t.index ["emp_no"], name: "emp_no"
|
86
86
|
end
|
87
87
|
|
88
88
|
create_table "dept_manager", id: false, force: :cascade do |t|
|
@@ -90,15 +90,15 @@ describe 'Ridgepole::Client#diff -> migrate' do
|
|
90
90
|
t.integer "emp_no", null: false
|
91
91
|
t.date "from_date", null: false
|
92
92
|
t.date "to_date", null: false
|
93
|
-
t.index ["dept_no"], name: "dept_no"
|
94
|
-
t.index ["emp_no"], name: "emp_no"
|
93
|
+
t.index ["dept_no"], name: "dept_no"
|
94
|
+
t.index ["emp_no"], name: "emp_no"
|
95
95
|
end
|
96
96
|
|
97
97
|
create_table "employee_clubs", force: :cascade do |t|
|
98
98
|
t.integer "emp_no", null: false
|
99
99
|
t.integer "club_id", null: false
|
100
100
|
t.string "any_col", null: false
|
101
|
-
t.index ["emp_no", "club_id"], name: "idx_emp_no_club_id"
|
101
|
+
t.index ["emp_no", "club_id"], name: "idx_emp_no_club_id"
|
102
102
|
end
|
103
103
|
|
104
104
|
create_table "employees", primary_key: "emp_no", force: :cascade do |t|
|
@@ -116,7 +116,7 @@ describe 'Ridgepole::Client#diff -> migrate' do
|
|
116
116
|
t.integer "salary", null: false
|
117
117
|
t.date "from_date", null: false
|
118
118
|
t.date "to_date", null: false
|
119
|
-
t.index ["emp_no"], name: "emp_no"
|
119
|
+
t.index ["emp_no"], name: "emp_no"
|
120
120
|
end
|
121
121
|
|
122
122
|
create_table "titles", id: false, force: :cascade do |t|
|
@@ -124,7 +124,7 @@ describe 'Ridgepole::Client#diff -> migrate' do
|
|
124
124
|
t.string "title", limit: 50, null: false
|
125
125
|
t.date "from_date", null: false
|
126
126
|
t.date "to_date"
|
127
|
-
t.index ["emp_no"], name: "emp_no"
|
127
|
+
t.index ["emp_no"], name: "emp_no"
|
128
128
|
end
|
129
129
|
ERB
|
130
130
|
end
|
@@ -162,7 +162,7 @@ describe 'Ridgepole::Client#diff -> migrate' do
|
|
162
162
|
t.string "last_name", limit: 16, null: false
|
163
163
|
t.string "gender", limit: 1, null: false
|
164
164
|
t.date "hire_date", null: false
|
165
|
-
t.index ["first_name"], name: "idx_first_name"
|
165
|
+
t.index ["first_name"], name: "idx_first_name"
|
166
166
|
end
|
167
167
|
ERB
|
168
168
|
end
|
@@ -179,7 +179,7 @@ describe 'Ridgepole::Client#diff -> migrate' do
|
|
179
179
|
migrated, sql = delta.migrate(alter_extra: alter_extra, noop: true)
|
180
180
|
expect(migrated).to be_truthy
|
181
181
|
expect(sql).to match_fuzzy erbh(<<-SQL)
|
182
|
-
CREATE INDEX `idx_first_name`
|
182
|
+
CREATE INDEX `idx_first_name` ON `employees` (`first_name`) LOCK=DEFAULT ALGORITHM=DEFAULT
|
183
183
|
SQL
|
184
184
|
delta.migrate(alter_extra: alter_extra)
|
185
185
|
expect(subject.dump).to match_ruby expected_dsl
|
@@ -195,7 +195,7 @@ describe 'Ridgepole::Client#diff -> migrate' do
|
|
195
195
|
t.string "last_name", limit: 16, null: false
|
196
196
|
t.string "gender", limit: 1, null: false
|
197
197
|
t.date "hire_date", null: false
|
198
|
-
t.index ["first_name"], name: "idx_first_name"
|
198
|
+
t.index ["first_name"], name: "idx_first_name"
|
199
199
|
end
|
200
200
|
ERB
|
201
201
|
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", limit: 4, 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
|
@@ -68,12 +68,12 @@ describe 'Ridgepole::Client#diff -> migrate' do
|
|
68
68
|
erbh(<<-ERB)
|
69
69
|
create_table "clubs", force: :cascade do |t|
|
70
70
|
t.string "name", default: "", null: false
|
71
|
-
t.index ["name"], name: "idx_name", unique: true
|
71
|
+
t.index ["name"], name: "idx_name", unique: true
|
72
72
|
end
|
73
73
|
|
74
74
|
create_table "departments", primary_key: "dept_no", force: :cascade do |t|
|
75
75
|
t.string "dept_name", limit: 40, null: false
|
76
|
-
t.index ["dept_name"], name: "dept_name", unique: true
|
76
|
+
t.index ["dept_name"], name: "dept_name", unique: true
|
77
77
|
end
|
78
78
|
|
79
79
|
create_table "dept_emp", id: false, force: :cascade do |t|
|
@@ -81,8 +81,8 @@ describe 'Ridgepole::Client#diff -> migrate' do
|
|
81
81
|
t.string "dept_no", limit: 4, null: false
|
82
82
|
t.date "from_date", null: false
|
83
83
|
t.date "to_date", null: false
|
84
|
-
t.index ["dept_no"], name: "dept_no"
|
85
|
-
t.index ["emp_no"], name: "emp_no"
|
84
|
+
t.index ["dept_no"], name: "dept_no"
|
85
|
+
t.index ["emp_no"], name: "emp_no"
|
86
86
|
end
|
87
87
|
|
88
88
|
create_table "dept_manager", id: false, force: :cascade do |t|
|
@@ -90,15 +90,15 @@ describe 'Ridgepole::Client#diff -> migrate' do
|
|
90
90
|
t.integer "emp_no", null: false
|
91
91
|
t.date "from_date", null: false
|
92
92
|
t.date "to_date", null: false
|
93
|
-
t.index ["dept_no"], name: "dept_no"
|
94
|
-
t.index ["emp_no"], name: "emp_no"
|
93
|
+
t.index ["dept_no"], name: "dept_no"
|
94
|
+
t.index ["emp_no"], name: "emp_no"
|
95
95
|
end
|
96
96
|
|
97
97
|
create_table "employee_clubs", force: :cascade do |t|
|
98
98
|
t.integer "emp_no", null: false
|
99
99
|
t.integer "club_id", null: false
|
100
100
|
t.string "any_col", null: false
|
101
|
-
t.index ["emp_no", "club_id"], name: "idx_emp_no_club_id"
|
101
|
+
t.index ["emp_no", "club_id"], name: "idx_emp_no_club_id"
|
102
102
|
end
|
103
103
|
|
104
104
|
create_table "employees", primary_key: "emp_no", force: :cascade do |t|
|
@@ -116,7 +116,7 @@ describe 'Ridgepole::Client#diff -> migrate' do
|
|
116
116
|
t.integer "salary", null: false
|
117
117
|
t.date "from_date", null: false
|
118
118
|
t.date "to_date", null: false
|
119
|
-
t.index ["emp_no"], name: "emp_no"
|
119
|
+
t.index ["emp_no"], name: "emp_no"
|
120
120
|
end
|
121
121
|
|
122
122
|
create_table "titles", id: false, force: :cascade do |t|
|
@@ -124,7 +124,7 @@ describe 'Ridgepole::Client#diff -> migrate' do
|
|
124
124
|
t.string "title", limit: 50, null: false
|
125
125
|
t.date "from_date", null: false
|
126
126
|
t.date "to_date"
|
127
|
-
t.index ["emp_no"], name: "emp_no"
|
127
|
+
t.index ["emp_no"], name: "emp_no"
|
128
128
|
end
|
129
129
|
ERB
|
130
130
|
end
|