Set MySQL collation: versions tbl: utf8mb4_general_ci

Should fix the "Unknown collation: 'utf8mb4_col'" error from
https://github.com/airblade/paper_trail/issues/741
This commit is contained in:
Jared Beck 2016-03-31 16:18:55 -04:00
parent b722f64520
commit 0435936a37
3 changed files with 3 additions and 3 deletions

View File

@ -58,7 +58,7 @@ class CreateVersions < ActiveRecord::Migration
#
def versions_table_options
if MYSQL_ADAPTERS.include?(connection.class.name)
{ options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_col" }
{ options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci" }
else
{}
end

View File

@ -36,7 +36,7 @@ RSpec.describe CreateVersions do
it "uses utf8mb4_col collation" do
migration.change
expect(migration).to have_received(:create_table) do |_, arg2|
expect(arg2[:options]).to match(/COLLATE=utf8mb4_col/)
expect(arg2[:options]).to match(/COLLATE=utf8mb4_general_ci/)
end
end
else

View File

@ -301,7 +301,7 @@ class SetUpTestTables < ActiveRecord::Migration
def versions_table_options
opts = { force: true }
if MYSQL_ADAPTERS.include?(connection.class.name)
opts[:options] = "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_col"
opts[:options] = "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci"
end
opts
end