aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/schema
diff options
context:
space:
mode:
authorRyuta Kamizono <kamipo@gmail.com>2018-07-09 04:27:35 +0900
committerRyuta Kamizono <kamipo@gmail.com>2018-07-09 04:27:35 +0900
commitf7c5a8ce262cf16ad8d7c0b0d631a4b88afec414 (patch)
treee6aaa038fb4649a7c393975781a3b4cdc5251705 /activerecord/test/schema
parent0d54a51065950a3d7f496ff5422bb78fa24de854 (diff)
downloadrails-f7c5a8ce262cf16ad8d7c0b0d631a4b88afec414.tar.gz
rails-f7c5a8ce262cf16ad8d7c0b0d631a4b88afec414.tar.bz2
rails-f7c5a8ce262cf16ad8d7c0b0d631a4b88afec414.zip
Subsecond precision is not supported until MySQL 5.6.4
Diffstat (limited to 'activerecord/test/schema')
-rw-r--r--activerecord/test/schema/mysql2_specific_schema.rb12
1 files changed, 6 insertions, 6 deletions
diff --git a/activerecord/test/schema/mysql2_specific_schema.rb b/activerecord/test/schema/mysql2_specific_schema.rb
index 1ac3b60c92..5d9ffd104d 100644
--- a/activerecord/test/schema/mysql2_specific_schema.rb
+++ b/activerecord/test/schema/mysql2_specific_schema.rb
@@ -2,17 +2,17 @@
ActiveRecord::Schema.define do
- if ActiveRecord::Base.connection.version >= "5.6.0"
+ if subsecond_precision_supported?
create_table :datetime_defaults, force: true do |t|
t.datetime :modified_datetime, default: -> { "CURRENT_TIMESTAMP" }
t.datetime :precise_datetime, precision: 6, default: -> { "CURRENT_TIMESTAMP(6)" }
end
- end
- create_table :timestamp_defaults, force: true do |t|
- t.timestamp :nullable_timestamp
- t.timestamp :modified_timestamp, default: -> { "CURRENT_TIMESTAMP" }
- t.timestamp :precise_timestamp, precision: 6, default: -> { "CURRENT_TIMESTAMP(6)" }
+ create_table :timestamp_defaults, force: true do |t|
+ t.timestamp :nullable_timestamp
+ t.timestamp :modified_timestamp, default: -> { "CURRENT_TIMESTAMP" }
+ t.timestamp :precise_timestamp, precision: 6, default: -> { "CURRENT_TIMESTAMP(6)" }
+ end
end
create_table :binary_fields, force: true do |t|