diff options
author | Nikolay Kondratyev <nkondratyev@yandex.ru> | 2018-07-03 12:17:40 +0500 |
---|---|---|
committer | Nikolay Kondratyev <nkondratyev@yandex.ru> | 2018-07-04 10:45:02 +0500 |
commit | 64078e088650124b6c37ce6a3c352ad2dc4f072c (patch) | |
tree | b339e7f98bd2b4d9e9523eb84b08f2c39f9ef82f /activerecord/CHANGELOG.md | |
parent | 90e2739d8680878b40224d68b366917b9c582ba5 (diff) | |
download | rails-64078e088650124b6c37ce6a3c352ad2dc4f072c.tar.gz rails-64078e088650124b6c37ce6a3c352ad2dc4f072c.tar.bz2 rails-64078e088650124b6c37ce6a3c352ad2dc4f072c.zip |
Fix default value for mysql time types with specified precision
The TIME, DATETIME, and TIMESTAMP types [have supported](https://mariadb.com/kb/en/library/microseconds-in-mariadb/)
a fractional seconds precision from 0 to 6.
Default values from time columns with specified precision is read
as `current_timestamp(n)` from information schema.
rake `db:schema:dump` produces `schema.rb` **without** default values for time columns with the specified precision:
t.datetime "last_message_at", precision: 6, null: false
rake `db:schema:dump` produces `schema.rb` **with** default values for time columns with the specified precision:
t.datetime "last_message_at", precision: 6, default: -> { "current_timestamp(6)" }, null: false
Diffstat (limited to 'activerecord/CHANGELOG.md')
-rw-r--r-- | activerecord/CHANGELOG.md | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/activerecord/CHANGELOG.md b/activerecord/CHANGELOG.md index fad09182c9..d14e0a930a 100644 --- a/activerecord/CHANGELOG.md +++ b/activerecord/CHANGELOG.md @@ -1,3 +1,7 @@ +* Fix default value for mysql time types with specified precision + + *Nikolay Kondratyev* + * Fix `touch` option to behave consistently with `Persistence#touch` method. *Ryuta Kamizono* |