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:
parent
b722f64520
commit
0435936a37
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue