3

I'm running automated tests for a Rails app in Codeship, and I'd like to use utf8mb4 as the database encoding.

Here's my modified database.yml:

test:
  adapter: mysql2
  host: localhost
  encoding: utf8mb4
  collation: utf8mb4_unicode_ci
  pool: 10
  username: <%= ENV['MYSQL_USER'] %>
  password: <%= ENV['MYSQL_PASSWORD'] %>
  database: test<%= ENV['TEST_ENV_NUMBER'] %>
  socket: /var/run/mysqld/mysqld.sock

I followed this tutorial: https://codeship.com/documentation/databases/mysql/ , but the encoding is still utf8.

How can I run the tests using a utf8mb4 encoding for the database?

jlhonora
  • 10,179
  • 10
  • 46
  • 70
  • On the create table statements specify CHARSET and collation. Related: http://stackoverflow.com/a/37649531 – Drew Jun 10 '16 at 14:43

0 Answers0