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/schema
Rafael Mendonça França d895186395
Dump the precision for datetime columns following the new defaults
Since Rails 7.0 the datetime column precision is 6 by default.

That means that `t.datetime` calls without setting the `:precision`
option would have its precision set to 6.

The schema dumper was generating a call without precision for columns
with the precision set to `nil` (which has the same effect of 0), making
the schema dump incorrect for the next load since that would be interpreted
as if the precision was 6.

This didn't affect MySQL since #44171, since MySQL precision is 0 by default
not `nil` but it affected PostgreSQL and SQLite3.

Now the dumper will generate the precision as 0 for columns without
precision and omit it when the precision is 6.

Related to #43909.
2022-02-08 01:36:06 +00:00
..
mysql2_specific_schema.rb Extract on update CURRENT_TIMESTAMP for mysql2 adapter 2022-01-01 21:37:15 +09:00
oracle_specific_schema.rb
postgresql_specific_schema.rb Dump the precision for datetime columns following the new defaults 2022-02-08 01:36:06 +00:00
schema.rb Fix error when saving an association with a relation named record 2022-01-17 21:46:54 +01:00
sqlite_specific_schema.rb Dump the precision for datetime columns following the new defaults 2022-02-08 01:36:06 +00:00