ridgepole 0.7.0.alpha → 0.7.0.alpha2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rspec +1 -0
- data/.travis.yml +1 -0
- data/README.md +7 -5
- data/bin/ridgepole +14 -14
- data/lib/ridgepole/cli/config.rb +1 -1
- data/lib/ridgepole/client.rb +0 -4
- data/lib/ridgepole/delta.rb +15 -9
- data/lib/ridgepole/diff.rb +13 -9
- data/lib/ridgepole/dsl_parser/context.rb +2 -6
- data/lib/ridgepole/version.rb +1 -1
- data/ridgepole.gemspec +3 -1
- data/spec/erb_helper.rb +0 -39
- data/spec/hide_pending_formatter.rb +6 -0
- data/spec/mysql/bigint_pk/bigint_pk_spec.rb +9 -9
- data/spec/mysql/bigint_pk/int_pk_spec.rb +9 -9
- data/spec/mysql/cli/ridgepole_spec.rb +2 -2
- data/spec/mysql/collation/collation_spec.rb +28 -28
- data/spec/mysql/comment/comment_spec.rb +36 -36
- data/spec/mysql/default_lambda/default_lambda_spec.rb +1 -1
- data/spec/mysql/diff/diff2_spec.rb +41 -41
- data/spec/mysql/diff/diff_spec.rb +41 -41
- data/spec/mysql/dump/dump_class_method_spec.rb +26 -33
- data/spec/mysql/dump/dump_some_tables_spec.rb +16 -18
- data/spec/mysql/dump/dump_spec.rb +27 -34
- data/spec/mysql/dump/dump_without_table_options_spec.rb +5 -5
- data/spec/mysql/fk/migrate_change_fk_spec.rb +76 -23
- data/spec/mysql/fk/migrate_create_fk_spec.rb +70 -50
- data/spec/mysql/fk/migrate_drop_fk_spec.rb +131 -32
- data/spec/mysql/migrate/check_orphan_index_spec.rb +19 -19
- data/spec/mysql/migrate/migrate_add_column2_spec.rb +33 -45
- data/spec/mysql/migrate/migrate_add_column_order_spec.rb +47 -47
- data/spec/mysql/migrate/migrate_add_column_spec.rb +75 -89
- data/spec/mysql/migrate/migrate_add_column_with_alter_extra_spec.rb +72 -86
- data/spec/mysql/migrate/migrate_add_column_with_script_spec.rb +72 -86
- data/spec/mysql/migrate/migrate_change_column2_spec.rb +27 -32
- data/spec/mysql/migrate/migrate_change_column3_spec.rb +78 -78
- data/spec/mysql/migrate/migrate_change_column4_spec.rb +24 -24
- data/spec/mysql/migrate/migrate_change_column5_spec.rb +42 -42
- data/spec/mysql/migrate/migrate_change_column6_spec.rb +60 -60
- data/spec/mysql/migrate/migrate_change_column_default_spec.rb +47 -47
- data/spec/mysql/migrate/migrate_change_column_float_spec.rb +16 -16
- data/spec/mysql/migrate/migrate_change_column_spec.rb +65 -79
- data/spec/mysql/migrate/migrate_change_index2_spec.rb +22 -27
- data/spec/mysql/migrate/migrate_change_index3_spec.rb +52 -62
- data/spec/mysql/migrate/migrate_change_index4_spec.rb +32 -38
- data/spec/mysql/migrate/migrate_change_index5_spec.rb +24 -28
- data/spec/mysql/migrate/migrate_change_index6_spec.rb +105 -119
- data/spec/mysql/migrate/migrate_change_index7_spec.rb +27 -30
- data/spec/mysql/migrate/migrate_change_index_spec.rb +99 -120
- data/spec/mysql/migrate/migrate_change_table_option_spec.rb +14 -14
- data/spec/mysql/migrate/migrate_create_index2_spec.rb +101 -112
- data/spec/mysql/migrate/migrate_create_index_spec.rb +55 -66
- data/spec/mysql/migrate/migrate_create_table_spec.rb +68 -91
- data/spec/mysql/migrate/migrate_create_table_with_options_spec.rb +1 -1
- data/spec/mysql/migrate/migrate_create_table_with_script_spec.rb +58 -70
- data/spec/mysql/migrate/migrate_drop_column_and_index2_spec.rb +62 -76
- data/spec/mysql/migrate/migrate_drop_column_and_index_spec.rb +58 -72
- data/spec/mysql/migrate/migrate_drop_column_spec.rb +63 -77
- data/spec/mysql/migrate/migrate_drop_index_spec.rb +55 -66
- data/spec/mysql/migrate/migrate_drop_table_spec.rb +51 -63
- data/spec/mysql/migrate/migrate_duplicate_index_spec.rb +3 -3
- data/spec/mysql/migrate/migrate_duplicate_table_spec.rb +12 -12
- data/spec/mysql/migrate/migrate_empty_spec.rb +35 -42
- data/spec/mysql/migrate/migrate_execute_spec.rb +16 -24
- data/spec/mysql/migrate/migrate_log_file_spec.rb +58 -70
- data/spec/mysql/migrate/migrate_merge_mode_spec.rb +75 -99
- data/spec/mysql/migrate/migrate_noop_spec.rb +38 -38
- data/spec/mysql/migrate/migrate_rename_column_spec.rb +74 -88
- data/spec/mysql/migrate/migrate_rename_table_spec.rb +100 -97
- data/spec/mysql/migrate/migrate_same_default_null_spec.rb +18 -18
- data/spec/mysql/migrate/migrate_same_spec.rb +29 -37
- data/spec/mysql/migrate/migrate_script_error_spec.rb +19 -19
- data/spec/mysql/migrate/migrate_skip_drop_table_spec.rb +148 -0
- data/spec/mysql/migrate/migrate_skip_rename_column_spec.rb +70 -84
- data/spec/mysql/migrate/migrate_skip_rename_table_spec.rb +70 -84
- data/spec/mysql/migrate/migrate_with_ignore_tables_spec.rb +87 -87
- data/spec/mysql/migrate/migrate_with_pre_post_query_spec.rb +61 -75
- data/spec/mysql/migrate/migrate_with_tables_spec.rb +41 -41
- data/spec/mysql/migrate/migrate_with_verbose_log_spec.rb +10 -10
- data/spec/mysql/migrate_/migrate_create_index_with_alter_spec.rb +67 -78
- data/spec/mysql/migrate_/migrate_drop_index_with_alter_spec.rb +67 -78
- data/spec/mysql/text_blob_types/text_blob_types_spec.rb +9 -9
- data/spec/mysql/~default_name_fk/migrate_change_fk_spec.rb +21 -24
- data/spec/mysql/~default_name_fk/migrate_create_fk_spec.rb +35 -67
- data/spec/mysql/~default_name_fk/migrate_drop_fk_spec.rb +28 -34
- data/spec/postgresql/diff/diff_spec.rb +37 -37
- data/spec/postgresql/dump/dump_spec.rb +27 -34
- data/spec/postgresql/fk/migrate_change_fk_spec.rb +76 -23
- data/spec/postgresql/fk/migrate_create_fk_spec.rb +73 -54
- data/spec/postgresql/fk/migrate_drop_fk_spec.rb +131 -32
- data/spec/postgresql/migrate/migrate_add_column_spec.rb +63 -75
- data/spec/postgresql/migrate/migrate_add_expression_index_spec.rb +1 -1
- data/spec/postgresql/migrate/migrate_change_column_default_spec.rb +7 -7
- data/spec/postgresql/migrate/migrate_change_column_spec.rb +53 -65
- data/spec/postgresql/migrate/migrate_change_index_spec.rb +54 -68
- data/spec/postgresql/migrate/migrate_create_table_spec.rb +56 -77
- data/spec/postgresql/migrate/migrate_drop_column_spec.rb +46 -60
- data/spec/postgresql/migrate/migrate_drop_column_with_index_spec.rb +41 -55
- data/spec/postgresql/migrate/migrate_drop_expression_index_spec.rb +3 -3
- data/spec/postgresql/migrate/migrate_drop_index_spec.rb +51 -62
- data/spec/postgresql/migrate/migrate_drop_table_spec.rb +48 -60
- data/spec/postgresql/migrate/migrate_ext_cols_spec.rb +6 -6
- data/spec/postgresql/migrate/migrate_rename_column_spec.rb +54 -68
- data/spec/postgresql/migrate/migrate_rename_table_spec.rb +62 -78
- data/spec/postgresql/migrate/migrate_same_spec.rb +27 -34
- data/spec/postgresql/~default_name_fk/migrate_change_fk_spec.rb +21 -24
- data/spec/postgresql/~default_name_fk/migrate_create_fk_spec.rb +35 -66
- data/spec/postgresql/~default_name_fk/migrate_drop_fk_spec.rb +28 -34
- data/spec/spec_helper.rb +1 -1
- metadata +9 -8
- data/ridgepole.iml +0 -9
- data/spec/string_ext.rb +0 -40
@@ -3,28 +3,26 @@ describe 'Ridgepole::Client#diff -> migrate' do
|
|
3
3
|
let(:actual_dsl) {
|
4
4
|
erbh(<<-EOS)
|
5
5
|
create_table "employees", primary_key: "emp_no", force: :cascade do |t|
|
6
|
-
t.date "birth_date",
|
6
|
+
t.date "birth_date", null: false
|
7
7
|
t.string "first_name", limit: 14, null: false
|
8
|
-
t.string "last_name",
|
9
|
-
t.string "gender",
|
10
|
-
t.date "hire_date",
|
8
|
+
t.string "last_name", limit: 16, null: false
|
9
|
+
t.string "gender", limit: 1, null: false
|
10
|
+
t.date "hire_date", null: false
|
11
|
+
t.index ["gender"], name: "gender", <%= i cond(5.0, using: :btree) %>
|
11
12
|
end
|
12
|
-
|
13
|
-
<%= add_index "employees", ["gender"], name: "gender", using: :btree %>
|
14
13
|
EOS
|
15
14
|
}
|
16
15
|
|
17
16
|
let(:expected_dsl) {
|
18
17
|
erbh(<<-EOS)
|
19
18
|
create_table :employees, primary_key: :emp_no, force: :cascade do |t|
|
20
|
-
t.date "birth_date",
|
19
|
+
t.date "birth_date", null: false
|
21
20
|
t.string "first_name", limit: 14, null: false
|
22
|
-
t.string "last_name",
|
23
|
-
t.string "gender",
|
24
|
-
t.date :hire_date,
|
21
|
+
t.string "last_name", limit: 16, null: false
|
22
|
+
t.string "gender", limit: 1, null: false
|
23
|
+
t.date :hire_date, null: false
|
24
|
+
t.index :gender, name: :gender, <%= i cond(5.0, using: :btree) %>
|
25
25
|
end
|
26
|
-
|
27
|
-
<%= add_index :employees, :gender, name: :gender, using: :btree %>
|
28
26
|
EOS
|
29
27
|
}
|
30
28
|
|
@@ -40,43 +38,40 @@ describe 'Ridgepole::Client#diff -> migrate' do
|
|
40
38
|
context 'when change column (change)' do
|
41
39
|
let(:actual_dsl) {
|
42
40
|
erbh(<<-EOS)
|
43
|
-
create_table "employees", primary_key: "emp_no",
|
44
|
-
t.date "birth_date",
|
41
|
+
create_table "employees", primary_key: "emp_no", force: :cascade do |t|
|
42
|
+
t.date "birth_date", null: false
|
45
43
|
t.string "first_name", limit: 14, null: false
|
46
|
-
t.string "last_name",
|
47
|
-
t.string "gender",
|
48
|
-
t.date "hire_date",
|
44
|
+
t.string "last_name", limit: 16, null: false
|
45
|
+
t.string "gender", limit: 1, null: false
|
46
|
+
t.date "hire_date", null: false
|
47
|
+
t.index ["gender"], name: "gender", <%= i cond(5.0, using: :btree) %>
|
49
48
|
end
|
50
|
-
|
51
|
-
<%= add_index "employees", ["gender"], name: "gender", using: :btree %>
|
52
49
|
EOS
|
53
50
|
}
|
54
51
|
|
55
52
|
let(:dsl) {
|
56
53
|
erbh(<<-EOS)
|
57
54
|
create_table :employees, primary_key: :emp_no, force: :cascade do |t|
|
58
|
-
t.date "birth_date",
|
55
|
+
t.date "birth_date", null: false
|
59
56
|
t.string "first_name", limit: 14, null: false
|
60
|
-
t.string "last_name",
|
61
|
-
t.string "gender",
|
62
|
-
t.date :hire_date2,
|
57
|
+
t.string "last_name", limit: 16, null: false
|
58
|
+
t.string "gender", limit: 1, null: false
|
59
|
+
t.date :hire_date2, null: false
|
60
|
+
t.index :last_name, name: :last_name, <%= i cond(5.0, using: :btree) %>
|
63
61
|
end
|
64
|
-
|
65
|
-
<%= add_index :employees, :last_name, name: :last_name, using: :btree %>
|
66
62
|
EOS
|
67
63
|
}
|
68
64
|
|
69
65
|
let(:expected_dsl) {
|
70
66
|
erbh(<<-EOS)
|
71
|
-
create_table "employees", primary_key: "emp_no",
|
72
|
-
t.date "birth_date",
|
67
|
+
create_table "employees", primary_key: "emp_no", force: :cascade do |t|
|
68
|
+
t.date "birth_date", null: false
|
73
69
|
t.string "first_name", limit: 14, null: false
|
74
|
-
t.string "last_name",
|
75
|
-
t.string "gender",
|
76
|
-
t.date "hire_date2",
|
70
|
+
t.string "last_name", limit: 16, null: false
|
71
|
+
t.string "gender", limit: 1, null: false
|
72
|
+
t.date "hire_date2", null: false
|
73
|
+
t.index ["last_name"], name: "last_name", <%= i cond(5.0, using: :btree) %>
|
77
74
|
end
|
78
|
-
|
79
|
-
<%= add_index "employees", ["last_name"], name: "last_name", using: :btree %>
|
80
75
|
EOS
|
81
76
|
}
|
82
77
|
|
@@ -3,13 +3,13 @@ describe 'Ridgepole::Client#diff -> migrate' do
|
|
3
3
|
let(:actual_dsl) {
|
4
4
|
<<-EOS
|
5
5
|
create_table "employees", primary_key: "emp_no", force: :cascade do |t|
|
6
|
-
t.date "birth_date",
|
6
|
+
t.date "birth_date", null: false
|
7
7
|
t.string "first_name", limit: 14, null: false
|
8
|
-
t.string "last_name",
|
9
|
-
t.string "gender",
|
10
|
-
t.date "hire_date",
|
11
|
-
t.datetime "created_at",
|
12
|
-
t.datetime "updated_at",
|
8
|
+
t.string "last_name", limit: 16, null: false
|
9
|
+
t.string "gender", limit: 1, null: false
|
10
|
+
t.date "hire_date", null: false
|
11
|
+
t.datetime "created_at", null: false
|
12
|
+
t.datetime "updated_at", null: false
|
13
13
|
end
|
14
14
|
EOS
|
15
15
|
}
|
@@ -17,11 +17,11 @@ describe 'Ridgepole::Client#diff -> migrate' do
|
|
17
17
|
let(:expected_dsl) {
|
18
18
|
<<-EOS
|
19
19
|
create_table "employees", primary_key: "emp_no", force: :cascade do |t|
|
20
|
-
t.date "birth_date",
|
20
|
+
t.date "birth_date", null: false
|
21
21
|
t.string "first_name", limit: 14, null: false
|
22
|
-
t.string "last_name",
|
23
|
-
t.string "gender",
|
24
|
-
t.date "hire_date",
|
22
|
+
t.string "last_name", limit: 16, null: false
|
23
|
+
t.string "gender", limit: 1, null: false
|
24
|
+
t.date "hire_date", null: false
|
25
25
|
t.timestamps
|
26
26
|
end
|
27
27
|
EOS
|
@@ -39,12 +39,12 @@ describe 'Ridgepole::Client#diff -> migrate' do
|
|
39
39
|
context 'when use timestamps (change)' do
|
40
40
|
let(:actual_dsl) {
|
41
41
|
erbh(<<-EOS)
|
42
|
-
create_table "employees", primary_key: "emp_no",
|
43
|
-
t.date "birth_date",
|
42
|
+
create_table "employees", primary_key: "emp_no", force: :cascade do |t|
|
43
|
+
t.date "birth_date", null: false
|
44
44
|
t.string "first_name", limit: 14, null: false
|
45
|
-
t.string "last_name",
|
46
|
-
t.string "gender",
|
47
|
-
t.date "hire_date",
|
45
|
+
t.string "last_name", limit: 16, null: false
|
46
|
+
t.string "gender", limit: 1, null: false
|
47
|
+
t.date "hire_date", null: false
|
48
48
|
end
|
49
49
|
EOS
|
50
50
|
}
|
@@ -52,11 +52,11 @@ describe 'Ridgepole::Client#diff -> migrate' do
|
|
52
52
|
let(:dsl) {
|
53
53
|
<<-EOS
|
54
54
|
create_table "employees", primary_key: "emp_no", force: :cascade do |t|
|
55
|
-
t.date "birth_date",
|
55
|
+
t.date "birth_date", null: false
|
56
56
|
t.string "first_name", limit: 14, null: false
|
57
|
-
t.string "last_name",
|
58
|
-
t.string "gender",
|
59
|
-
t.date "hire_date",
|
57
|
+
t.string "last_name", limit: 16, null: false
|
58
|
+
t.string "gender", limit: 1, null: false
|
59
|
+
t.date "hire_date", null: false
|
60
60
|
t.timestamps
|
61
61
|
end
|
62
62
|
EOS
|
@@ -64,14 +64,14 @@ describe 'Ridgepole::Client#diff -> migrate' do
|
|
64
64
|
|
65
65
|
let(:expected_dsl) {
|
66
66
|
erbh(<<-EOS)
|
67
|
-
create_table "employees", primary_key: "emp_no",
|
68
|
-
t.date "birth_date",
|
67
|
+
create_table "employees", primary_key: "emp_no", force: :cascade do |t|
|
68
|
+
t.date "birth_date", null: false
|
69
69
|
t.string "first_name", limit: 14, null: false
|
70
|
-
t.string "last_name",
|
71
|
-
t.string "gender",
|
72
|
-
t.date "hire_date",
|
73
|
-
t.datetime "created_at",
|
74
|
-
t.datetime "updated_at",
|
70
|
+
t.string "last_name", limit: 16, null: false
|
71
|
+
t.string "gender", limit: 1, null: false
|
72
|
+
t.date "hire_date", null: false
|
73
|
+
t.datetime "created_at", null: false
|
74
|
+
t.datetime "updated_at", null: false
|
75
75
|
end
|
76
76
|
EOS
|
77
77
|
}
|
@@ -92,11 +92,11 @@ describe 'Ridgepole::Client#diff -> migrate' do
|
|
92
92
|
let(:actual_dsl) {
|
93
93
|
<<-EOS
|
94
94
|
create_table "employees", primary_key: "emp_no", force: :cascade do |t|
|
95
|
-
t.date "birth_date",
|
95
|
+
t.date "birth_date", null: false
|
96
96
|
t.string "first_name", limit: 14, null: false
|
97
|
-
t.string "last_name",
|
98
|
-
t.string "gender",
|
99
|
-
t.date "hire_date",
|
97
|
+
t.string "last_name", limit: 16, null: false
|
98
|
+
t.string "gender", limit: 1, null: false
|
99
|
+
t.date "hire_date", null: false
|
100
100
|
t.integer "products_id"
|
101
101
|
t.integer "user_id"
|
102
102
|
end
|
@@ -106,11 +106,11 @@ describe 'Ridgepole::Client#diff -> migrate' do
|
|
106
106
|
let(:expected_dsl) {
|
107
107
|
<<-EOS
|
108
108
|
create_table "employees", primary_key: "emp_no", force: :cascade do |t|
|
109
|
-
t.date "birth_date",
|
109
|
+
t.date "birth_date", null: false
|
110
110
|
t.string "first_name", limit: 14, null: false
|
111
|
-
t.string "last_name",
|
112
|
-
t.string "gender",
|
113
|
-
t.date "hire_date",
|
111
|
+
t.string "last_name", limit: 16, null: false
|
112
|
+
t.string "gender", limit: 1, null: false
|
113
|
+
t.date "hire_date", null: false
|
114
114
|
t.references :products, :user
|
115
115
|
end
|
116
116
|
EOS
|
@@ -129,11 +129,11 @@ describe 'Ridgepole::Client#diff -> migrate' do
|
|
129
129
|
let(:actual_dsl) {
|
130
130
|
<<-EOS
|
131
131
|
create_table "employees", primary_key: "emp_no", force: :cascade do |t|
|
132
|
-
t.date "birth_date",
|
132
|
+
t.date "birth_date", null: false
|
133
133
|
t.string "first_name", limit: 14, null: false
|
134
|
-
t.string "last_name",
|
135
|
-
t.string "gender",
|
136
|
-
t.date "hire_date",
|
134
|
+
t.string "last_name", limit: 16, null: false
|
135
|
+
t.string "gender", limit: 1, null: false
|
136
|
+
t.date "hire_date", null: false
|
137
137
|
t.integer "products_id"
|
138
138
|
t.string "products_type"
|
139
139
|
t.integer "user_id"
|
@@ -145,11 +145,11 @@ describe 'Ridgepole::Client#diff -> migrate' do
|
|
145
145
|
let(:expected_dsl) {
|
146
146
|
<<-EOS
|
147
147
|
create_table "employees", primary_key: "emp_no", force: :cascade do |t|
|
148
|
-
t.date "birth_date",
|
148
|
+
t.date "birth_date", null: false
|
149
149
|
t.string "first_name", limit: 14, null: false
|
150
|
-
t.string "last_name",
|
151
|
-
t.string "gender",
|
152
|
-
t.date "hire_date",
|
150
|
+
t.string "last_name", limit: 16, null: false
|
151
|
+
t.string "gender", limit: 1, null: false
|
152
|
+
t.date "hire_date", null: false
|
153
153
|
t.references :products, :user, polymorphic: true
|
154
154
|
end
|
155
155
|
EOS
|
@@ -167,12 +167,12 @@ describe 'Ridgepole::Client#diff -> migrate' do
|
|
167
167
|
context 'when use references (change)' do
|
168
168
|
let(:actual_dsl) {
|
169
169
|
erbh(<<-EOS)
|
170
|
-
create_table "employees", primary_key: "emp_no",
|
171
|
-
t.date "birth_date",
|
170
|
+
create_table "employees", primary_key: "emp_no", force: :cascade do |t|
|
171
|
+
t.date "birth_date", null: false
|
172
172
|
t.string "first_name", limit: 14, null: false
|
173
|
-
t.string "last_name",
|
174
|
-
t.string "gender",
|
175
|
-
t.date "hire_date",
|
173
|
+
t.string "last_name", limit: 16, null: false
|
174
|
+
t.string "gender", limit: 1, null: false
|
175
|
+
t.date "hire_date", null: false
|
176
176
|
end
|
177
177
|
EOS
|
178
178
|
}
|
@@ -180,11 +180,11 @@ describe 'Ridgepole::Client#diff -> migrate' do
|
|
180
180
|
let(:dsl) {
|
181
181
|
<<-EOS
|
182
182
|
create_table "employees", primary_key: "emp_no", force: :cascade do |t|
|
183
|
-
t.date "birth_date",
|
183
|
+
t.date "birth_date", null: false
|
184
184
|
t.string "first_name", limit: 14, null: false
|
185
|
-
t.string "last_name",
|
186
|
-
t.string "gender",
|
187
|
-
t.date "hire_date",
|
185
|
+
t.string "last_name", limit: 16, null: false
|
186
|
+
t.string "gender", limit: 1, null: false
|
187
|
+
t.date "hire_date", null: false
|
188
188
|
t.references :products, :user
|
189
189
|
end
|
190
190
|
EOS
|
@@ -192,14 +192,14 @@ describe 'Ridgepole::Client#diff -> migrate' do
|
|
192
192
|
|
193
193
|
let(:expected_dsl) {
|
194
194
|
erbh(<<-EOS)
|
195
|
-
create_table "employees", primary_key: "emp_no",
|
196
|
-
t.date "birth_date",
|
197
|
-
t.string "first_name",
|
198
|
-
t.string "last_name",
|
199
|
-
t.string "gender",
|
200
|
-
t.date "hire_date",
|
201
|
-
t.integer "products_id"
|
202
|
-
t.integer "user_id"
|
195
|
+
create_table "employees", primary_key: "emp_no", force: :cascade do |t|
|
196
|
+
t.date "birth_date", null: false
|
197
|
+
t.string "first_name", limit: 14, null: false
|
198
|
+
t.string "last_name", limit: 16, null: false
|
199
|
+
t.string "gender", limit: 1, null: false
|
200
|
+
t.date "hire_date", null: false
|
201
|
+
t.integer "products_id"
|
202
|
+
t.integer "user_id"
|
203
203
|
end
|
204
204
|
EOS
|
205
205
|
}
|
@@ -219,12 +219,12 @@ describe 'Ridgepole::Client#diff -> migrate' do
|
|
219
219
|
context 'when use references with polymorphic (change)' do
|
220
220
|
let(:actual_dsl) {
|
221
221
|
erbh(<<-EOS)
|
222
|
-
create_table "employees", primary_key: "emp_no",
|
223
|
-
t.date "birth_date",
|
222
|
+
create_table "employees", primary_key: "emp_no", force: :cascade do |t|
|
223
|
+
t.date "birth_date", null: false
|
224
224
|
t.string "first_name", limit: 14, null: false
|
225
|
-
t.string "last_name",
|
226
|
-
t.string "gender",
|
227
|
-
t.date "hire_date",
|
225
|
+
t.string "last_name", limit: 16, null: false
|
226
|
+
t.string "gender", limit: 1, null: false
|
227
|
+
t.date "hire_date", null: false
|
228
228
|
end
|
229
229
|
EOS
|
230
230
|
}
|
@@ -232,11 +232,11 @@ describe 'Ridgepole::Client#diff -> migrate' do
|
|
232
232
|
let(:dsl) {
|
233
233
|
<<-EOS
|
234
234
|
create_table "employees", primary_key: "emp_no", force: :cascade do |t|
|
235
|
-
t.date "birth_date",
|
235
|
+
t.date "birth_date", null: false
|
236
236
|
t.string "first_name", limit: 14, null: false
|
237
|
-
t.string "last_name",
|
238
|
-
t.string "gender",
|
239
|
-
t.date "hire_date",
|
237
|
+
t.string "last_name", limit: 16, null: false
|
238
|
+
t.string "gender", limit: 1, null: false
|
239
|
+
t.date "hire_date", null: false
|
240
240
|
t.references :products, :user, polymorphic: true
|
241
241
|
end
|
242
242
|
EOS
|
@@ -244,16 +244,16 @@ describe 'Ridgepole::Client#diff -> migrate' do
|
|
244
244
|
|
245
245
|
let(:expected_dsl) {
|
246
246
|
erbh(<<-EOS)
|
247
|
-
create_table "employees", primary_key: "emp_no",
|
248
|
-
t.date "birth_date",
|
249
|
-
t.string "first_name",
|
250
|
-
t.string "last_name",
|
251
|
-
t.string "gender",
|
252
|
-
t.date "hire_date",
|
253
|
-
t.integer "products_id"
|
254
|
-
t.string "products_type"
|
255
|
-
t.integer "user_id"
|
256
|
-
t.string "user_type"
|
247
|
+
create_table "employees", primary_key: "emp_no", force: :cascade do |t|
|
248
|
+
t.date "birth_date", null: false
|
249
|
+
t.string "first_name", limit: 14, null: false
|
250
|
+
t.string "last_name", limit: 16, null: false
|
251
|
+
t.string "gender", limit: 1, null: false
|
252
|
+
t.date "hire_date", null: false
|
253
|
+
t.integer "products_id"
|
254
|
+
t.string "products_type"
|
255
|
+
t.integer "user_id"
|
256
|
+
t.string "user_type"
|
257
257
|
end
|
258
258
|
EOS
|
259
259
|
}
|
@@ -3,13 +3,13 @@ describe 'Ridgepole::Client#diff -> migrate' do
|
|
3
3
|
let(:actual_dsl) {
|
4
4
|
<<-EOS
|
5
5
|
create_table "employees", primary_key: "emp_no", force: :cascade do |t|
|
6
|
-
t.date "birth_date",
|
6
|
+
t.date "birth_date", null: false
|
7
7
|
t.string "first_name", limit: 14, null: false
|
8
|
-
t.string "last_name",
|
9
|
-
t.string "gender",
|
10
|
-
t.date "hire_date",
|
11
|
-
t.datetime "created_at",
|
12
|
-
t.datetime "updated_at",
|
8
|
+
t.string "last_name", limit: 16, null: false
|
9
|
+
t.string "gender", limit: 1, null: false
|
10
|
+
t.date "hire_date", null: false
|
11
|
+
t.datetime "created_at", null: false
|
12
|
+
t.datetime "updated_at", null: false
|
13
13
|
t.boolean "registered"
|
14
14
|
end
|
15
15
|
EOS
|
@@ -18,13 +18,13 @@ describe 'Ridgepole::Client#diff -> migrate' do
|
|
18
18
|
let(:expected_dsl) {
|
19
19
|
<<-EOS
|
20
20
|
create_table "employees", primary_key: "emp_no", force: :cascade do |t|
|
21
|
-
t.date "birth_date",
|
21
|
+
t.date "birth_date", null: false
|
22
22
|
t.string "first_name", limit: 14, null: false
|
23
|
-
t.string "last_name",
|
24
|
-
t.string "gender",
|
25
|
-
t.date "hire_date",
|
26
|
-
t.datetime "created_at",
|
27
|
-
t.datetime "updated_at",
|
23
|
+
t.string "last_name", limit: 16, null: false
|
24
|
+
t.string "gender", limit: 1, null: false
|
25
|
+
t.date "hire_date", null: false
|
26
|
+
t.datetime "created_at", null: false
|
27
|
+
t.datetime "updated_at", null: false
|
28
28
|
t.boolean "registered"
|
29
29
|
end
|
30
30
|
EOS
|
@@ -43,13 +43,13 @@ describe 'Ridgepole::Client#diff -> migrate' do
|
|
43
43
|
let(:actual_dsl) {
|
44
44
|
<<-EOS
|
45
45
|
create_table "employees", primary_key: "emp_no", force: :cascade do |t|
|
46
|
-
t.date "birth_date",
|
46
|
+
t.date "birth_date", null: false
|
47
47
|
t.string "first_name", limit: 14, null: false
|
48
|
-
t.string "last_name",
|
49
|
-
t.string "gender",
|
50
|
-
t.date "hire_date",
|
51
|
-
t.datetime "created_at",
|
52
|
-
t.datetime "updated_at",
|
48
|
+
t.string "last_name", limit: 16, null: false
|
49
|
+
t.string "gender", limit: 1, null: false
|
50
|
+
t.date "hire_date", null: false
|
51
|
+
t.datetime "created_at", null: false
|
52
|
+
t.datetime "updated_at", null: false
|
53
53
|
t.boolean "registered"
|
54
54
|
end
|
55
55
|
EOS
|
@@ -58,13 +58,13 @@ describe 'Ridgepole::Client#diff -> migrate' do
|
|
58
58
|
let(:expected_dsl) {
|
59
59
|
<<-EOS
|
60
60
|
create_table "employees", primary_key: "emp_no", force: :cascade do |t|
|
61
|
-
t.date "birth_date",
|
61
|
+
t.date "birth_date", null: false
|
62
62
|
t.string "first_name", limit: 14, null: false
|
63
|
-
t.string "last_name",
|
64
|
-
t.string "gender",
|
65
|
-
t.date "hire_date",
|
66
|
-
t.datetime "created_at",
|
67
|
-
t.datetime "updated_at",
|
63
|
+
t.string "last_name", limit: 16, null: false
|
64
|
+
t.string "gender", limit: 1, null: false
|
65
|
+
t.date "hire_date", null: false
|
66
|
+
t.datetime "created_at", null: false
|
67
|
+
t.datetime "updated_at", null: false
|
68
68
|
t.boolean "registered", limit: 1
|
69
69
|
end
|
70
70
|
EOS
|
@@ -3,13 +3,13 @@ describe 'Ridgepole::Client#diff -> migrate' do
|
|
3
3
|
let(:actual_dsl) {
|
4
4
|
erbh(<<-EOS)
|
5
5
|
create_table "employees", primary_key: "emp_no", force: :cascade do |t|
|
6
|
-
t.date "birth_date",
|
7
|
-
t.string "first_name",
|
8
|
-
t.string "last_name",
|
9
|
-
t.string "gender",
|
10
|
-
t.date "hire_date",
|
11
|
-
t.datetime "created_at",
|
12
|
-
t.datetime "updated_at",
|
6
|
+
t.date "birth_date", null: false
|
7
|
+
t.string "first_name", limit: 14, null: false
|
8
|
+
t.string "last_name", limit: 16, null: false
|
9
|
+
t.string "gender", limit: 1, null: false
|
10
|
+
t.date "hire_date", null: false
|
11
|
+
t.datetime "created_at", null: false
|
12
|
+
t.datetime "updated_at", null: false
|
13
13
|
t.binary "registered_name", <%= i cond(5.0, limit: 65535) %>
|
14
14
|
end
|
15
15
|
EOS
|
@@ -18,13 +18,13 @@ describe 'Ridgepole::Client#diff -> migrate' do
|
|
18
18
|
let(:expected_dsl) {
|
19
19
|
erbh(<<-EOS)
|
20
20
|
create_table "employees", primary_key: "emp_no", force: :cascade do |t|
|
21
|
-
t.date "birth_date",
|
22
|
-
t.string "first_name",
|
23
|
-
t.string "last_name",
|
24
|
-
t.string "gender",
|
25
|
-
t.date "hire_date",
|
26
|
-
t.datetime "created_at",
|
27
|
-
t.datetime "updated_at",
|
21
|
+
t.date "birth_date", null: false
|
22
|
+
t.string "first_name", limit: 14, null: false
|
23
|
+
t.string "last_name", limit: 16, null: false
|
24
|
+
t.string "gender", limit: 1, null: false
|
25
|
+
t.date "hire_date", null: false
|
26
|
+
t.datetime "created_at", null: false
|
27
|
+
t.datetime "updated_at", null: false
|
28
28
|
t.binary "registered_name", limit: 255
|
29
29
|
end
|
30
30
|
EOS
|
@@ -46,13 +46,13 @@ describe 'Ridgepole::Client#diff -> migrate' do
|
|
46
46
|
let(:actual_dsl) {
|
47
47
|
erbh(<<-EOS)
|
48
48
|
create_table "employees", primary_key: "emp_no", force: :cascade do |t|
|
49
|
-
t.date "birth_date",
|
50
|
-
t.string "first_name",
|
51
|
-
t.string "last_name",
|
52
|
-
t.string "gender",
|
53
|
-
t.date "hire_date",
|
54
|
-
t.datetime "created_at",
|
55
|
-
t.datetime "updated_at",
|
49
|
+
t.date "birth_date", null: false
|
50
|
+
t.string "first_name", limit: 14, null: false
|
51
|
+
t.string "last_name", limit: 16, null: false
|
52
|
+
t.string "gender", limit: 1, null: false
|
53
|
+
t.date "hire_date", null: false
|
54
|
+
t.datetime "created_at", null: false
|
55
|
+
t.datetime "updated_at", null: false
|
56
56
|
t.binary "registered_name", limit: 255
|
57
57
|
end
|
58
58
|
EOS
|
@@ -61,13 +61,13 @@ describe 'Ridgepole::Client#diff -> migrate' do
|
|
61
61
|
let(:expected_dsl) {
|
62
62
|
erbh(<<-EOS)
|
63
63
|
create_table "employees", primary_key: "emp_no", force: :cascade do |t|
|
64
|
-
t.date "birth_date",
|
65
|
-
t.string "first_name",
|
66
|
-
t.string "last_name",
|
67
|
-
t.string "gender",
|
68
|
-
t.date "hire_date",
|
69
|
-
t.datetime "created_at",
|
70
|
-
t.datetime "updated_at",
|
64
|
+
t.date "birth_date", null: false
|
65
|
+
t.string "first_name", limit: 14, null: false
|
66
|
+
t.string "last_name", limit: 16, null: false
|
67
|
+
t.string "gender", limit: 1, null: false
|
68
|
+
t.date "hire_date", null: false
|
69
|
+
t.datetime "created_at", null: false
|
70
|
+
t.datetime "updated_at", null: false
|
71
71
|
t.binary "registered_name", <%= i cond(5.0, limit: 65535) %>
|
72
72
|
end
|
73
73
|
EOS
|
@@ -89,13 +89,13 @@ describe 'Ridgepole::Client#diff -> migrate' do
|
|
89
89
|
let(:actual_dsl) {
|
90
90
|
erbh(<<-EOS)
|
91
91
|
create_table "employees", primary_key: "emp_no", force: :cascade do |t|
|
92
|
-
t.date "birth_date",
|
93
|
-
t.string "first_name",
|
94
|
-
t.string "last_name",
|
95
|
-
t.string "gender",
|
96
|
-
t.date "hire_date",
|
97
|
-
t.datetime "created_at",
|
98
|
-
t.datetime "updated_at",
|
92
|
+
t.date "birth_date", null: false
|
93
|
+
t.string "first_name", limit: 14, null: false
|
94
|
+
t.string "last_name", limit: 16, null: false
|
95
|
+
t.string "gender", limit: 1, null: false
|
96
|
+
t.date "hire_date", null: false
|
97
|
+
t.datetime "created_at", null: false
|
98
|
+
t.datetime "updated_at", null: false
|
99
99
|
t.binary "registered_name", <%= i cond(5.0, limit: 65535) %>
|
100
100
|
end
|
101
101
|
EOS
|
@@ -104,13 +104,13 @@ describe 'Ridgepole::Client#diff -> migrate' do
|
|
104
104
|
let(:expected_dsl) {
|
105
105
|
<<-EOS
|
106
106
|
create_table "employees", primary_key: "emp_no", force: :cascade do |t|
|
107
|
-
t.date "birth_date",
|
108
|
-
t.string "first_name",
|
109
|
-
t.string "last_name",
|
110
|
-
t.string "gender",
|
111
|
-
t.date "hire_date",
|
112
|
-
t.datetime "created_at",
|
113
|
-
t.datetime "updated_at",
|
107
|
+
t.date "birth_date", null: false
|
108
|
+
t.string "first_name", limit: 14, null: false
|
109
|
+
t.string "last_name", limit: 16, null: false
|
110
|
+
t.string "gender", limit: 1, null: false
|
111
|
+
t.date "hire_date", null: false
|
112
|
+
t.datetime "created_at", null: false
|
113
|
+
t.datetime "updated_at", null: false
|
114
114
|
t.binary "registered_name"
|
115
115
|
end
|
116
116
|
EOS
|