@@ -182,41 +182,39 @@ class MysqlDefaultExpressionTest < ActiveRecord::TestCase
182
182
end
183
183
end
184
184
185
- if supports_datetime_with_precision?
186
- test "schema dump datetime includes default expression" do
187
- output = dump_table_schema ( "datetime_defaults" )
188
- assert_match %r/t\. datetime\s +"modified_datetime",\s +precision: nil,\s +default: -> { "CURRENT_TIMESTAMP(?:\( \) )?" }/i , output
189
- end
185
+ test "schema dump datetime includes default expression" do
186
+ output = dump_table_schema ( "datetime_defaults" )
187
+ assert_match %r/t\. datetime\s +"modified_datetime",\s +precision: nil,\s +default: -> { "CURRENT_TIMESTAMP(?:\( \) )?" }/i , output
188
+ end
190
189
191
- test "schema dump datetime includes precise default expression" do
192
- output = dump_table_schema ( "datetime_defaults" )
193
- assert_match %r/t\. datetime\s +"precise_datetime",\s +default: -> { "CURRENT_TIMESTAMP\( 6\) " }/i , output
194
- end
190
+ test "schema dump datetime includes precise default expression" do
191
+ output = dump_table_schema ( "datetime_defaults" )
192
+ assert_match %r/t\. datetime\s +"precise_datetime",\s +default: -> { "CURRENT_TIMESTAMP\( 6\) " }/i , output
193
+ end
195
194
196
- test "schema dump datetime includes precise default expression with on update" do
197
- output = dump_table_schema ( "datetime_defaults" )
198
- assert_match %r/t\. datetime\s +"updated_datetime",\s +default: -> { "CURRENT_TIMESTAMP\( 6\) ON UPDATE CURRENT_TIMESTAMP\( 6\) " }/i , output
199
- end
195
+ test "schema dump datetime includes precise default expression with on update" do
196
+ output = dump_table_schema ( "datetime_defaults" )
197
+ assert_match %r/t\. datetime\s +"updated_datetime",\s +default: -> { "CURRENT_TIMESTAMP\( 6\) ON UPDATE CURRENT_TIMESTAMP\( 6\) " }/i , output
198
+ end
200
199
201
- test "schema dump timestamp includes default expression" do
202
- output = dump_table_schema ( "timestamp_defaults" )
203
- assert_match %r/t\. timestamp\s +"modified_timestamp",\s +default: -> { "CURRENT_TIMESTAMP(?:\( \) )?" }/i , output
204
- end
200
+ test "schema dump timestamp includes default expression" do
201
+ output = dump_table_schema ( "timestamp_defaults" )
202
+ assert_match %r/t\. timestamp\s +"modified_timestamp",\s +default: -> { "CURRENT_TIMESTAMP(?:\( \) )?" }/i , output
203
+ end
205
204
206
- test "schema dump timestamp includes precise default expression" do
207
- output = dump_table_schema ( "timestamp_defaults" )
208
- assert_match %r/t\. timestamp\s +"precise_timestamp",.+default: -> { "CURRENT_TIMESTAMP\( 6\) " }/i , output
209
- end
205
+ test "schema dump timestamp includes precise default expression" do
206
+ output = dump_table_schema ( "timestamp_defaults" )
207
+ assert_match %r/t\. timestamp\s +"precise_timestamp",.+default: -> { "CURRENT_TIMESTAMP\( 6\) " }/i , output
208
+ end
210
209
211
- test "schema dump timestamp includes precise default expression with on update" do
212
- output = dump_table_schema ( "timestamp_defaults" )
213
- assert_match %r/t\. timestamp\s +"updated_timestamp",.+default: -> { "CURRENT_TIMESTAMP\( 6\) ON UPDATE CURRENT_TIMESTAMP\( 6\) " }/i , output
214
- end
210
+ test "schema dump timestamp includes precise default expression with on update" do
211
+ output = dump_table_schema ( "timestamp_defaults" )
212
+ assert_match %r/t\. timestamp\s +"updated_timestamp",.+default: -> { "CURRENT_TIMESTAMP\( 6\) ON UPDATE CURRENT_TIMESTAMP\( 6\) " }/i , output
213
+ end
215
214
216
- test "schema dump timestamp without default expression" do
217
- output = dump_table_schema ( "timestamp_defaults" )
218
- assert_match %r/t\. timestamp\s +"nullable_timestamp"$/ , output
219
- end
215
+ test "schema dump timestamp without default expression" do
216
+ output = dump_table_schema ( "timestamp_defaults" )
217
+ assert_match %r/t\. timestamp\s +"nullable_timestamp"$/ , output
220
218
end
221
219
end
222
220
end
0 commit comments