Skip to content

Commit 731b51f

Browse files
Jubekitaylorotwell
authored andcommitted
[11.x] Add mariadb to databases config (#48455)
* Add MariaDB to databases config and Change MySQL 8 collation * Update tests workflow for MariaDB * Update default collation for mariadb
1 parent 5676bfb commit 731b51f

File tree

2 files changed

+22
-2
lines changed

2 files changed

+22
-2
lines changed

.github/workflows/databases.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ jobs:
140140
- name: Execute tests
141141
run: vendor/bin/phpunit tests/Integration/Database
142142
env:
143-
DB_CONNECTION: mysql
143+
DB_CONNECTION: mariadb
144144
DB_USERNAME: root
145145

146146
pgsql:

config/database.php

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,27 @@
4848
'password' => env('DB_PASSWORD', ''),
4949
'unix_socket' => env('DB_SOCKET', ''),
5050
'charset' => 'utf8mb4',
51-
'collation' => 'utf8mb4_unicode_ci',
51+
'collation' => 'utf8mb4_0900_ai_ci',
52+
'prefix' => '',
53+
'prefix_indexes' => true,
54+
'strict' => true,
55+
'engine' => null,
56+
'options' => extension_loaded('pdo_mysql') ? array_filter([
57+
PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'),
58+
]) : [],
59+
],
60+
61+
'mariadb' => [
62+
'driver' => 'mysql',
63+
'url' => env('DB_URL'),
64+
'host' => env('DB_HOST', '127.0.0.1'),
65+
'port' => env('DB_PORT', '3306'),
66+
'database' => env('DB_DATABASE', 'forge'),
67+
'username' => env('DB_USERNAME', 'forge'),
68+
'password' => env('DB_PASSWORD', ''),
69+
'unix_socket' => env('DB_SOCKET', ''),
70+
'charset' => 'utf8mb4',
71+
'collation' => 'utf8mb4_uca1400_ai_ci',
5272
'prefix' => '',
5373
'prefix_indexes' => true,
5474
'strict' => true,

0 commit comments

Comments
 (0)