Skip to content

Commit 250a12f

Browse files
committed
chore: set collation specific to mariadb and fix phinx configuration
1 parent e3fe0cd commit 250a12f

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

docker-compose.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,10 @@ services:
77
MARIADB_DATABASE: ushahidi
88
MARIADB_USER: ushahidi
99
MARIADB_PASSWORD: ushahidi
10+
LANG: C.UTF_8
1011
command:
1112
- --character-set-server=utf8mb4
12-
- --collation-server=utf8mb4_unicode_ci
13+
- --collation-server=utf8mb4_unicode_520_ci
1314
# mysql 8.0
1415
# - --default-authentication-plugin=mysql_native_password
1516
ports:

phinx.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,14 @@
1515
'user' => getenv('DB_USERNAME'),
1616
'pass' => getenv('DB_PASSWORD'),
1717
'unix_socket' => getenv('DB_SOCKET'),
18-
'charset' => 'utf8',
18+
// afaik, phinx doesn't really use this for table creation in v0.11.7
19+
// apparently it's used as a connection parameter
20+
'charset' => 'utf8mb4',
21+
// phinx guesses the charset to create the table with from this
22+
// defaults to MariaDB's utf8mb4_unicode_520_ci, which is not supported by MySQL
23+
// for MySQL you would want to use utf8mb4_0900_ai_ci (MySQL 8.0.17+)
24+
// if you are stuck with MySQL 5.7, you can use utf8mb4_unicode_ci
25+
'collation' => getenv('DB_COLLATION') ?: 'utf8mb4_unicode_520_ci'
1926
],
2027
]
2128
];

0 commit comments

Comments
 (0)