diff --git a/docker-compose.yml b/docker-compose.yml index caa0d6cda..2be975535 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -7,9 +7,10 @@ services: MARIADB_DATABASE: ushahidi MARIADB_USER: ushahidi MARIADB_PASSWORD: ushahidi + LANG: C.UTF_8 command: - --character-set-server=utf8mb4 - - --collation-server=utf8mb4_unicode_ci + - --collation-server=utf8mb4_unicode_520_ci # mysql 8.0 # - --default-authentication-plugin=mysql_native_password ports: diff --git a/phinx.php b/phinx.php index 1b4fd5049..a2c86b74e 100644 --- a/phinx.php +++ b/phinx.php @@ -15,7 +15,14 @@ 'user' => getenv('DB_USERNAME'), 'pass' => getenv('DB_PASSWORD'), 'unix_socket' => getenv('DB_SOCKET'), - 'charset' => 'utf8', + // afaik, phinx doesn't really use this for table creation in v0.11.7 + // apparently it's used as a connection parameter + 'charset' => 'utf8mb4', + // phinx guesses the charset to create the table with from this + // defaults to MariaDB's utf8mb4_unicode_520_ci, which is not supported by MySQL + // for MySQL you would want to use utf8mb4_0900_ai_ci (MySQL 8.0.17+) + // if you are stuck with MySQL 5.7, you can use utf8mb4_unicode_ci + 'collation' => getenv('DB_COLLATION') ?: 'utf8mb4_unicode_520_ci' ], ] ];