You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In Rails 6.1 and below, precision is nil when using change_column to set the column type to datetime without explicit option. In Rails 7.0, precision is 6 even if the migration version is specified as ActiveRecord::Migration[6.1]. This will result in different schemas when running rails db:migrate in Rails 6.1 and Rails 7.0.
#42297 changed the default datetime precision to 6. In Rails7.0, ActiveRecord::Migration[6.1] or lower version includes the following support to maintain the original behavior.
In Rails 6.1 and below, precision is nil when using
change_column
to set the column type to datetime without explicit option. In Rails 7.0, precision is 6 even if the migration version is specified asActiveRecord::Migration[6.1]
. This will result in different schemas when runningrails db:migrate
in Rails 6.1 and Rails 7.0.#42297 changed the default datetime precision to 6. In Rails7.0,
ActiveRecord::Migration[6.1]
or lower version includes the following support to maintain the original behavior.rails/activerecord/lib/active_record/migration/compatibility.rb
Line 204 in 2fa5493
rails/activerecord/lib/active_record/migration/compatibility.rb
Line 174 in 2fa5493
but there seems to be no support for
change_column
Steps to reproduce
Using PostgreSQL because I can't reproduce with sqlite3
Expected behavior
the test pass
Actual behavior
the test fails.
System configuration
Rails version:
7.0.7
Ruby version:
3.2.2
The text was updated successfully, but these errors were encountered: