From 70043da86a3510063c668061bd84d1661188d3e8 Mon Sep 17 00:00:00 2001
From: Yasuo Honda <yasuo.honda@gmail.com>
Date: Wed, 12 Sep 2018 23:16:43 +0000
Subject: Raise an exception if :charset is not specified and large prefixes /
 utf8mb4 are not supported

---
 .../lib/active_record/connection_adapters/abstract_mysql_adapter.rb     | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'activerecord')

diff --git a/activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb b/activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb
index ebfb33005c..982a38d6e1 100644
--- a/activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb
+++ b/activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb
@@ -263,7 +263,7 @@ module ActiveRecord
         elsif supports_longer_index_key_prefix?
           execute "CREATE DATABASE #{quote_table_name(name)} DEFAULT CHARACTER SET `utf8mb4`"
         else
-          execute "CREATE DATABASE #{quote_table_name(name)} DEFAULT CHARACTER SET `utf8`"
+          raise "Configure a supported :charset and ensure innodb_large_prefix is enabled to support indexes on varchar(255) string columns."
         end
       end
 
-- 
cgit v1.2.3