mirror of
https://github.com/archtechx/tenancy.git
synced 2025-12-12 12:24:04 +00:00
Update SQL syntax in tests for MySQL 8 (#35)
* Bump MySQL to v8 in CI * Remove `identified by` from queries executed in tests
This commit is contained in:
parent
ce8e74e978
commit
fd6070ff1b
2 changed files with 4 additions and 4 deletions
4
.github/workflows/ci.yml
vendored
4
.github/workflows/ci.yml
vendored
|
|
@ -55,7 +55,7 @@ jobs:
|
||||||
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 3
|
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 3
|
||||||
|
|
||||||
mysql:
|
mysql:
|
||||||
image: mysql:5.7
|
image: mysql:8
|
||||||
env:
|
env:
|
||||||
MYSQL_ALLOW_EMPTY_PASSWORD: false
|
MYSQL_ALLOW_EMPTY_PASSWORD: false
|
||||||
MYSQL_ROOT_PASSWORD: password
|
MYSQL_ROOT_PASSWORD: password
|
||||||
|
|
@ -65,7 +65,7 @@ jobs:
|
||||||
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
|
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
|
||||||
|
|
||||||
mysql2:
|
mysql2:
|
||||||
image: mysql:5.7
|
image: mysql:8
|
||||||
env:
|
env:
|
||||||
MYSQL_ALLOW_EMPTY_PASSWORD: false
|
MYSQL_ALLOW_EMPTY_PASSWORD: false
|
||||||
MYSQL_ROOT_PASSWORD: password
|
MYSQL_ROOT_PASSWORD: password
|
||||||
|
|
|
||||||
|
|
@ -305,7 +305,7 @@ test('database credentials can be provided to PermissionControlledMySQLDatabaseM
|
||||||
$password = Str::random('8');
|
$password = Str::random('8');
|
||||||
$mysql2DB = DB::connection('mysql2');
|
$mysql2DB = DB::connection('mysql2');
|
||||||
$mysql2DB->statement("CREATE USER `{$username}`@`%` IDENTIFIED BY '{$password}';");
|
$mysql2DB->statement("CREATE USER `{$username}`@`%` IDENTIFIED BY '{$password}';");
|
||||||
$mysql2DB->statement("GRANT ALL PRIVILEGES ON *.* TO `{$username}`@`%` identified by '{$password}' WITH GRANT OPTION;");
|
$mysql2DB->statement("GRANT ALL PRIVILEGES ON *.* TO `{$username}`@`%` WITH GRANT OPTION;");
|
||||||
$mysql2DB->statement("FLUSH PRIVILEGES;");
|
$mysql2DB->statement("FLUSH PRIVILEGES;");
|
||||||
|
|
||||||
DB::purge('mysql2'); // forget the mysql2 connection so that it uses the new credentials the next time
|
DB::purge('mysql2'); // forget the mysql2 connection so that it uses the new credentials the next time
|
||||||
|
|
@ -350,7 +350,7 @@ test('tenant database can be created by using the username and password from ten
|
||||||
$password = Str::random('8');
|
$password = Str::random('8');
|
||||||
$mysqlDB = DB::connection('mysql');
|
$mysqlDB = DB::connection('mysql');
|
||||||
$mysqlDB->statement("CREATE USER `{$username}`@`%` IDENTIFIED BY '{$password}';");
|
$mysqlDB->statement("CREATE USER `{$username}`@`%` IDENTIFIED BY '{$password}';");
|
||||||
$mysqlDB->statement("GRANT ALL PRIVILEGES ON *.* TO `{$username}`@`%` identified by '{$password}' WITH GRANT OPTION;");
|
$mysqlDB->statement("GRANT ALL PRIVILEGES ON *.* TO `{$username}`@`%` WITH GRANT OPTION;");
|
||||||
$mysqlDB->statement("FLUSH PRIVILEGES;");
|
$mysqlDB->statement("FLUSH PRIVILEGES;");
|
||||||
|
|
||||||
DB::purge('mysql2'); // forget the mysql2 connection so that it uses the new credentials the next time
|
DB::purge('mysql2'); // forget the mysql2 connection so that it uses the new credentials the next time
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue