Remedy for "Uniqueness validator will no longer enforce case sensitive comparison in Rails 6.1."

Regarding the content

――Mr. Ito, who is famous for cherry books, has written a very easy-to-understand article, so please have a look there. - https://qiita.com/jnchito/items/e23b1facc72bd86234b6

solution

--For Rails, you don't have to execute queries or change MySQL settings! Just rewrite it as follows! --Note that the changes will not be reflected if you use rails db: reset! --Execute rails db: drop and rails db: create --Maybe you can also use rails db: migrate: reset.

config/database.yml


default: &default
  adapter: mysql2
  encoding: utf8mb4
  charset: utf8mb4 #Postscript
  collation: utf8mb4_bin #Postscript
  reconnect: false

Recommended Posts

Remedy for "Uniqueness validator will no longer enforce case sensitive comparison in Rails 6.1."
What to do if you get the warning "Uniqueness validator will no longer enforce case sensitive comparison in Rails 6.1." in Rails 6.0
Remedy for command not found in rails s
SassC :: SyntaxError in Pages # index Remedy for rails5 Intermediate Tutorial