1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

"Uniqueness validator will no longer enforce case sensitive comparison in Rails 6.1."の対処法

Posted at

内容に関して

解決策

  • Railsの場合、クエリの実行やMySQLの設定を変更しなくても大丈夫!以下のように書き換えるだけです!
    • rails db:resetで行った場合変更が反映されないので注意!
    • rails db:dropとrails db:createを実施すること
      • おそらくrails db:migrate:resetでもいける。
config/database.yml
default: &default
  adapter: mysql2
  encoding: utf8mb4
  charset: utf8mb4 #追記
  collation: utf8mb4_bin #追記
  reconnect: false
1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?