Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(db): set collation specific to mariadb and fix phinx configuration #5013

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
9 changes: 8 additions & 1 deletion phinx.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'
],
]
];
Loading