1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/activerecord/test
Nikolay Kondratyev 64078e0886
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
2018-07-04 10:45:02 +05:00
..
active_record/connection_adapters Use frozen-string-literal in ActiveRecord 2017-07-19 22:27:07 +03:00
assets Use YAML to serialize schema cache 2016-11-27 22:09:58 -05:00
cases Fix default value for mysql time types with specified precision 2018-07-04 10:45:02 +05:00
fixtures Ensure to calculate column aliases after all table aliases are constructed 2018-06-19 22:21:51 +09:00
migrations Fix occurrences Fixnum|Bignum 2018-03-04 20:44:30 +02:00
models Ensure to calculate column aliases after all table aliases are constructed 2018-06-19 22:21:51 +09:00
schema Fix default value for mysql time types with specified precision 2018-07-04 10:45:02 +05:00
support Use frozen-string-literal in ActiveRecord 2017-07-19 22:27:07 +03:00
config.example.yml Fix tests for prepared_statements: false and queries hitting #select_all 2016-11-19 21:52:52 +05:30
config.rb Use frozen-string-literal in ActiveRecord 2017-07-19 22:27:07 +03:00