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
@@ -5,8 +5,8 @@ describe 'Ridgepole::Client#diff -> migrate' do
|
|
5
5
|
let(:actual_dsl) do
|
6
6
|
erbh(<<-ERB)
|
7
7
|
create_table "employees", primary_key: "emp_no", force: :cascade do |t|
|
8
|
-
t
|
9
|
-
t
|
8
|
+
t.bigint "products_id"
|
9
|
+
t.bigint "user_id"
|
10
10
|
t.index "products_id"
|
11
11
|
t.index "user_id"
|
12
12
|
end
|
@@ -34,9 +34,9 @@ describe 'Ridgepole::Client#diff -> migrate' do
|
|
34
34
|
let(:actual_dsl) do
|
35
35
|
erbh(<<-ERB)
|
36
36
|
create_table "employees", primary_key: "emp_no", force: :cascade do |t|
|
37
|
-
t
|
37
|
+
t.bigint "products_id"
|
38
38
|
t.string "products_type"
|
39
|
-
t
|
39
|
+
t.bigint "user_id"
|
40
40
|
t.string "user_type"
|
41
41
|
t.index ["products_type", "products_id"]
|
42
42
|
t.index ["user_type", "user_id"]
|
@@ -65,8 +65,8 @@ describe 'Ridgepole::Client#diff -> migrate' do
|
|
65
65
|
let(:actual_dsl) do
|
66
66
|
erbh(<<-ERB)
|
67
67
|
create_table "employees", primary_key: "emp_no", force: :cascade do |t|
|
68
|
-
t
|
69
|
-
t
|
68
|
+
t.bigint "products_id"
|
69
|
+
t.bigint "user_id"
|
70
70
|
end
|
71
71
|
ERB
|
72
72
|
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", limit: 255, 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: "idx_dept_name", unique: true
|
14
|
+
t.index ["dept_name"], name: "idx_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: "idx_dept_emp_dept_no"
|
23
|
-
t.index ["emp_no"], name: "idx_dept_emp_emp_no"
|
22
|
+
t.index ["dept_no"], name: "idx_dept_emp_dept_no"
|
23
|
+
t.index ["emp_no"], name: "idx_dept_emp_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: "idx_dept_manager_dept_no"
|
32
|
-
t.index ["emp_no"], name: "idx_dept_manager_emp_no"
|
31
|
+
t.index ["dept_no"], name: "idx_dept_manager_dept_no"
|
32
|
+
t.index ["emp_no"], name: "idx_dept_manager_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_employee_clubs_emp_no_club_id"
|
38
|
+
t.index ["emp_no", "club_id"], name: "idx_employee_clubs_emp_no_club_id"
|
39
39
|
end
|
40
40
|
|
41
41
|
create_table "employees", primary_key: "emp_no", force: :cascade do |t|
|
@@ -50,7 +50,7 @@ describe 'Ridgepole::Client#diff -> migrate' do
|
|
50
50
|
t.integer "salary", null: false
|
51
51
|
t.date "from_date", null: false
|
52
52
|
t.date "to_date", null: false
|
53
|
-
t.index ["emp_no"], name: "idx_salaries_emp_no"
|
53
|
+
t.index ["emp_no"], name: "idx_salaries_emp_no"
|
54
54
|
end
|
55
55
|
|
56
56
|
create_table "titles", id: false, force: :cascade do |t|
|
@@ -58,7 +58,7 @@ describe 'Ridgepole::Client#diff -> migrate' do
|
|
58
58
|
t.string "title", limit: 50, null: false
|
59
59
|
t.date "from_date", null: false
|
60
60
|
t.date "to_date"
|
61
|
-
t.index ["emp_no"], name: "idx_titles_emp_no"
|
61
|
+
t.index ["emp_no"], name: "idx_titles_emp_no"
|
62
62
|
end
|
63
63
|
ERB
|
64
64
|
end
|
@@ -67,12 +67,12 @@ describe 'Ridgepole::Client#diff -> migrate' do
|
|
67
67
|
erbh(<<-ERB)
|
68
68
|
create_table "clubs", force: :cascade do |t|
|
69
69
|
t.string "name", limit: 255, default: "", null: false
|
70
|
-
t.index ["name"], name: "idx_name", unique: true
|
70
|
+
t.index ["name"], name: "idx_name", unique: true
|
71
71
|
end
|
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: "idx_dept_name", unique: true
|
75
|
+
t.index ["dept_name"], name: "idx_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", limit: 4, null: false
|
81
81
|
t.date "from_date2", null: false, renamed_from: 'from_date'
|
82
82
|
t.date "to_date", null: false
|
83
|
-
t.index ["dept_no"], name: "idx_dept_emp_dept_no"
|
84
|
-
t.index ["emp_no"], name: "idx_dept_emp_emp_no"
|
83
|
+
t.index ["dept_no"], name: "idx_dept_emp_dept_no"
|
84
|
+
t.index ["emp_no"], name: "idx_dept_emp_emp_no"
|
85
85
|
end
|
86
86
|
|
87
87
|
create_table "dept_manager", id: false, force: :cascade do |t|
|
@@ -89,14 +89,14 @@ 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_date2", null: false, renamed_from: 'to_date'
|
92
|
-
t.index ["dept_no"], name: "idx_dept_manager_dept_no"
|
93
|
-
t.index ["emp_no"], name: "idx_dept_manager_emp_no"
|
92
|
+
t.index ["dept_no"], name: "idx_dept_manager_dept_no"
|
93
|
+
t.index ["emp_no"], name: "idx_dept_manager_emp_no"
|
94
94
|
end
|
95
95
|
|
96
96
|
create_table "employee_clubs", force: :cascade do |t|
|
97
97
|
t.integer "emp_no", null: false
|
98
98
|
t.integer "club_id", null: false
|
99
|
-
t.index ["emp_no", "club_id"], name: "idx_employee_clubs_emp_no_club_id"
|
99
|
+
t.index ["emp_no", "club_id"], name: "idx_employee_clubs_emp_no_club_id"
|
100
100
|
end
|
101
101
|
|
102
102
|
create_table "employees", primary_key: "emp_no", 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: "idx_salaries_emp_no"
|
114
|
+
t.index ["emp_no"], name: "idx_salaries_emp_no"
|
115
115
|
end
|
116
116
|
|
117
117
|
create_table "titles", id: false, force: :cascade do |t|
|
@@ -119,7 +119,7 @@ describe 'Ridgepole::Client#diff -> migrate' do
|
|
119
119
|
t.string "title", limit: 50, null: false
|
120
120
|
t.date "from_date", null: false
|
121
121
|
t.date "to_date"
|
122
|
-
t.index ["emp_no"], name: "idx_titles_emp_no"
|
122
|
+
t.index ["emp_no"], name: "idx_titles_emp_no"
|
123
123
|
end
|
124
124
|
ERB
|
125
125
|
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", limit: 255, 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: "idx_dept_name", unique: true
|
14
|
+
t.index ["dept_name"], name: "idx_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: "idx_dept_emp_dept_no"
|
23
|
-
t.index ["emp_no"], name: "idx_dept_emp_emp_no"
|
22
|
+
t.index ["dept_no"], name: "idx_dept_emp_dept_no"
|
23
|
+
t.index ["emp_no"], name: "idx_dept_emp_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: "idx_dept_manager_dept_no"
|
32
|
-
t.index ["emp_no"], name: "idx_dept_manager_emp_no"
|
31
|
+
t.index ["dept_no"], name: "idx_dept_manager_dept_no"
|
32
|
+
t.index ["emp_no"], name: "idx_dept_manager_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_employee_clubs_emp_no_club_id"
|
38
|
+
t.index ["emp_no", "club_id"], name: "idx_employee_clubs_emp_no_club_id"
|
39
39
|
end
|
40
40
|
|
41
41
|
create_table "employees", primary_key: "emp_no", force: :cascade do |t|
|
@@ -50,7 +50,7 @@ describe 'Ridgepole::Client#diff -> migrate' do
|
|
50
50
|
t.integer "salary", null: false
|
51
51
|
t.date "from_date", null: false
|
52
52
|
t.date "to_date", null: false
|
53
|
-
t.index ["emp_no"], name: "idx_salaries_emp_no"
|
53
|
+
t.index ["emp_no"], name: "idx_salaries_emp_no"
|
54
54
|
end
|
55
55
|
|
56
56
|
create_table "titles", id: false, force: :cascade do |t|
|
@@ -58,7 +58,7 @@ describe 'Ridgepole::Client#diff -> migrate' do
|
|
58
58
|
t.string "title", limit: 50, null: false
|
59
59
|
t.date "from_date", null: false
|
60
60
|
t.date "to_date"
|
61
|
-
t.index ["emp_no"], name: "idx_titles_emp_no"
|
61
|
+
t.index ["emp_no"], name: "idx_titles_emp_no"
|
62
62
|
end
|
63
63
|
ERB
|
64
64
|
end
|
@@ -67,12 +67,12 @@ describe 'Ridgepole::Client#diff -> migrate' do
|
|
67
67
|
erbh(<<-ERB)
|
68
68
|
create_table "clubs", force: :cascade do |t|
|
69
69
|
t.string "name", limit: 255, default: "", null: false
|
70
|
-
t.index ["name"], name: "idx_name", unique: true
|
70
|
+
t.index ["name"], name: "idx_name", unique: true
|
71
71
|
end
|
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: "idx_dept_name", unique: true
|
75
|
+
t.index ["dept_name"], name: "idx_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", limit: 4, null: false
|
81
81
|
t.date "from_date", null: false
|
82
82
|
t.date "to_date", null: false
|
83
|
-
t.index ["dept_no"], name: "idx_dept_emp_dept_no"
|
84
|
-
t.index ["emp_no"], name: "idx_dept_emp_emp_no"
|
83
|
+
t.index ["dept_no"], name: "idx_dept_emp_dept_no"
|
84
|
+
t.index ["emp_no"], name: "idx_dept_emp_emp_no"
|
85
85
|
end
|
86
86
|
|
87
87
|
create_table "dept_manager", id: false, force: :cascade do |t|
|
@@ -89,14 +89,14 @@ 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: "idx_dept_manager_dept_no"
|
93
|
-
t.index ["emp_no"], name: "idx_dept_manager_emp_no"
|
92
|
+
t.index ["dept_no"], name: "idx_dept_manager_dept_no"
|
93
|
+
t.index ["emp_no"], name: "idx_dept_manager_emp_no"
|
94
94
|
end
|
95
95
|
|
96
96
|
create_table "employee_clubs", force: :cascade do |t|
|
97
97
|
t.integer "emp_no", null: false
|
98
98
|
t.integer "club_id", null: false
|
99
|
-
t.index ["emp_no", "club_id"], name: "idx_employee_clubs_emp_no_club_id"
|
99
|
+
t.index ["emp_no", "club_id"], name: "idx_employee_clubs_emp_no_club_id"
|
100
100
|
end
|
101
101
|
|
102
102
|
create_table "employees2", primary_key: "emp_no", force: :cascade, renamed_from: 'employees' 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: "idx_salaries_emp_no"
|
114
|
+
t.index ["emp_no"], name: "idx_salaries_emp_no"
|
115
115
|
end
|
116
116
|
|
117
117
|
create_table "titles", id: false, force: :cascade do |t|
|
@@ -119,7 +119,7 @@ describe 'Ridgepole::Client#diff -> migrate' do
|
|
119
119
|
t.string "title", limit: 50, null: false
|
120
120
|
t.date "from_date", null: false
|
121
121
|
t.date "to_date"
|
122
|
-
t.index ["emp_no"], name: "idx_titles_emp_no"
|
122
|
+
t.index ["emp_no"], name: "idx_titles_emp_no"
|
123
123
|
end
|
124
124
|
ERB
|
125
125
|
end
|
@@ -144,7 +144,7 @@ describe 'Ridgepole::Client#diff -> migrate' do
|
|
144
144
|
t.string "first_name", limit: 14, null: false
|
145
145
|
t.string "last_name", limit: 16, null: false
|
146
146
|
t.date "hire_date", null: false
|
147
|
-
t.index ["first_name"], name: "first_name"
|
147
|
+
t.index ["first_name"], name: "first_name"
|
148
148
|
end
|
149
149
|
ERB
|
150
150
|
end
|
@@ -156,7 +156,7 @@ describe 'Ridgepole::Client#diff -> migrate' do
|
|
156
156
|
t.string "first_name", limit: 14, null: false
|
157
157
|
t.string "last_name", limit: 16, null: false
|
158
158
|
t.date "hire_date", null: false
|
159
|
-
t.index ["first_name"], name: "first_name"
|
159
|
+
t.index ["first_name"], name: "first_name"
|
160
160
|
end
|
161
161
|
ERB
|
162
162
|
end
|
@@ -4,14 +4,14 @@ describe 'Ridgepole::Client#diff -> migrate' do
|
|
4
4
|
context 'when database and definition are same' do
|
5
5
|
let(:dsl) do
|
6
6
|
erbh(<<-ERB)
|
7
|
-
create_table "clubs",
|
7
|
+
create_table "clubs", id: :serial, force: :cascade do |t|
|
8
8
|
t.string "name", limit: 255, 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", <%= i cond(">= 6.1", { id: { type: :string, limit: 4 } }, { id: :string, limit: 4 }) %>, force: :cascade do |t|
|
13
13
|
t.string "dept_name", limit: 40, null: false
|
14
|
-
t.index ["dept_name"], name: "idx_dept_name", unique: true
|
14
|
+
t.index ["dept_name"], name: "idx_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", 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: "idx_dept_emp_dept_no"
|
23
|
-
t.index ["emp_no"], name: "idx_dept_emp_emp_no"
|
22
|
+
t.index ["dept_no"], name: "idx_dept_emp_dept_no"
|
23
|
+
t.index ["emp_no"], name: "idx_dept_emp_emp_no"
|
24
24
|
end
|
25
25
|
|
26
26
|
create_table "dept_manager", primary_key: ["emp_no", "dept_no"], force: :cascade do |t|
|
@@ -28,17 +28,17 @@ 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: "idx_dept_manager_dept_no"
|
32
|
-
t.index ["emp_no"], name: "idx_dept_manager_emp_no"
|
31
|
+
t.index ["dept_no"], name: "idx_dept_manager_dept_no"
|
32
|
+
t.index ["emp_no"], name: "idx_dept_manager_emp_no"
|
33
33
|
end
|
34
34
|
|
35
|
-
create_table "employee_clubs",
|
35
|
+
create_table "employee_clubs", id: :serial, 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_employee_clubs_emp_no_club_id"
|
38
|
+
t.index ["emp_no", "club_id"], name: "idx_employee_clubs_emp_no_club_id"
|
39
39
|
end
|
40
40
|
|
41
|
-
create_table "employees", primary_key: "emp_no",
|
41
|
+
create_table "employees", primary_key: "emp_no", id: :integer, default: nil, force: :cascade do |t|
|
42
42
|
t.date "birth_date", null: false
|
43
43
|
t.string "first_name", limit: 14, null: false
|
44
44
|
t.string "last_name", limit: 16, null: false
|
@@ -50,7 +50,7 @@ describe 'Ridgepole::Client#diff -> migrate' do
|
|
50
50
|
t.integer "salary", null: false
|
51
51
|
t.date "from_date", null: false
|
52
52
|
t.date "to_date", null: false
|
53
|
-
t.index ["emp_no"], name: "idx_salaries_emp_no"
|
53
|
+
t.index ["emp_no"], name: "idx_salaries_emp_no"
|
54
54
|
end
|
55
55
|
|
56
56
|
create_table "titles", primary_key: ["emp_no", "title", "from_date"], force: :cascade do |t|
|
@@ -58,7 +58,7 @@ describe 'Ridgepole::Client#diff -> migrate' do
|
|
58
58
|
t.string "title", limit: 50, null: false
|
59
59
|
t.date "from_date", null: false
|
60
60
|
t.date "to_date"
|
61
|
-
t.index ["emp_no"], name: "idx_titles_emp_no"
|
61
|
+
t.index ["emp_no"], name: "idx_titles_emp_no"
|
62
62
|
end
|
63
63
|
ERB
|
64
64
|
end
|
@@ -9,7 +9,7 @@ describe 'Ridgepole::Client#diff -> migrate' do
|
|
9
9
|
|
10
10
|
create_table "child", force: :cascade do |t|
|
11
11
|
t.integer "parent_id"
|
12
|
-
t.index ["parent_id"], name: "par_id"
|
12
|
+
t.index ["parent_id"], name: "par_id"
|
13
13
|
end
|
14
14
|
|
15
15
|
add_foreign_key "child", "parent", name: "fk_rails_e74ce85cbc", on_delete: :cascade
|
@@ -20,7 +20,7 @@ describe 'Ridgepole::Client#diff -> migrate' do
|
|
20
20
|
erbh(<<-ERB)
|
21
21
|
create_table "child", force: :cascade do |t|
|
22
22
|
t.integer "parent_id"
|
23
|
-
t.index ["parent_id"], name: "par_id"
|
23
|
+
t.index ["parent_id"], name: "par_id"
|
24
24
|
end
|
25
25
|
|
26
26
|
create_table "parent", force: :cascade do |t|
|
@@ -34,7 +34,7 @@ describe 'Ridgepole::Client#diff -> migrate' do
|
|
34
34
|
erbh(<<-ERB)
|
35
35
|
create_table "child", force: :cascade do |t|
|
36
36
|
t.integer "parent_id"
|
37
|
-
t.index ["parent_id"], name: "par_id"
|
37
|
+
t.index ["parent_id"], name: "par_id"
|
38
38
|
end
|
39
39
|
|
40
40
|
create_table "parent", force: :cascade do |t|
|
@@ -6,7 +6,7 @@ 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
12
|
create_table "parent", force: :cascade do |t|
|
@@ -52,7 +52,7 @@ describe 'Ridgepole::Client#diff -> migrate' do
|
|
52
52
|
|
53
53
|
create_table "child", force: :cascade do |t|
|
54
54
|
t.integer "parent_id", unsigned: true
|
55
|
-
t.index ["parent_id"], name: "par_id"
|
55
|
+
t.index ["parent_id"], name: "par_id"
|
56
56
|
end
|
57
57
|
|
58
58
|
add_foreign_key "child", "parent", name: "fk_rails_e74ce85cbc"
|
@@ -63,7 +63,7 @@ describe 'Ridgepole::Client#diff -> migrate' do
|
|
63
63
|
erbh(<<-ERB)
|
64
64
|
create_table "child", force: :cascade do |t|
|
65
65
|
t.integer "parent_id"
|
66
|
-
t.index ["parent_id"], name: "par_id"
|
66
|
+
t.index ["parent_id"], name: "par_id"
|
67
67
|
end
|
68
68
|
|
69
69
|
create_table "parent", force: :cascade do |t|
|
@@ -94,7 +94,7 @@ describe 'Ridgepole::Client#diff -> migrate' do
|
|
94
94
|
|
95
95
|
create_table "child", force: :cascade do |t|
|
96
96
|
t.integer "parent_id", unsigned: true
|
97
|
-
t.index ["parent_id"], name: "par_id"
|
97
|
+
t.index ["parent_id"], name: "par_id"
|
98
98
|
end
|
99
99
|
|
100
100
|
add_foreign_key "child", "parent", name: "fk_rails_e74ce85cbc"
|
@@ -9,7 +9,7 @@ describe 'Ridgepole::Client#diff -> migrate' do
|
|
9
9
|
|
10
10
|
create_table "child", force: :cascade do |t|
|
11
11
|
t.integer "parent_id"
|
12
|
-
t.index ["parent_id"], name: "par_id"
|
12
|
+
t.index ["parent_id"], name: "par_id"
|
13
13
|
end
|
14
14
|
|
15
15
|
add_foreign_key "child", "parent", name: "fk_rails_e74ce85cbc"
|
@@ -26,7 +26,7 @@ describe 'Ridgepole::Client#diff -> migrate' do
|
|
26
26
|
erbh(<<-ERB)
|
27
27
|
create_table "child", force: :cascade do |t|
|
28
28
|
t.integer "parent_id"
|
29
|
-
t.index ["parent_id"], name: "par_id"
|
29
|
+
t.index ["parent_id"], name: "par_id"
|
30
30
|
end
|
31
31
|
|
32
32
|
create_table "parent", force: :cascade do |t|
|
@@ -65,7 +65,7 @@ describe 'Ridgepole::Client#diff -> migrate' do
|
|
65
65
|
|
66
66
|
create_table "child", force: :cascade do |t|
|
67
67
|
t.integer "parent_id", unsigned: true
|
68
|
-
t.index ["parent_id"], name: "par_id"
|
68
|
+
t.index ["parent_id"], name: "par_id"
|
69
69
|
end
|
70
70
|
|
71
71
|
add_foreign_key "child", "parent", name: "fk_rails_e74ce85cbc"
|
@@ -76,7 +76,7 @@ describe 'Ridgepole::Client#diff -> migrate' do
|
|
76
76
|
erbh(<<-ERB)
|
77
77
|
create_table "child", force: :cascade do |t|
|
78
78
|
t.integer "parent_id"
|
79
|
-
t.index ["parent_id"], name: "par_id"
|
79
|
+
t.index ["parent_id"], name: "par_id"
|
80
80
|
end
|
81
81
|
|
82
82
|
create_table "parent", force: :cascade do |t|
|