Add specific instructions for MySQL migration

The currently generated migration mentions that MySQL users should explicitly enable "fractional seconds precision", but doesn't provide specific steps to enable this. The user has to click the links to figure out what to do.
This change adds the specific migration statement that can be used.
This commit is contained in:
Alexis Reigel 2021-10-22 10:40:06 +02:00 committed by GitHub
parent 7e50b841ac
commit 0ab65735a9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -28,7 +28,9 @@ class CreateVersions < ActiveRecord::Migration<%= migration_version %>
# MySQL users should also upgrade to at least rails 4.2, which is the first
# version of ActiveRecord with support for fractional seconds in MySQL.
# (https://github.com/rails/rails/pull/14359)
#
#
# MySQL users should use the following line for `created_at`
# t.datetime :created_at, limit: 6
t.datetime :created_at
end
add_index :versions, %i(item_type item_id)