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

Connection for seeding testing db fails if DB PORT is not 3306 #6200

Closed
aleksasaric opened this issue Jun 26, 2022 · 3 comments · Fixed by #6236
Closed

Connection for seeding testing db fails if DB PORT is not 3306 #6200

aleksasaric opened this issue Jun 26, 2022 · 3 comments · Fixed by #6236
Labels

Comments

@aleksasaric
Copy link

For developers forking and installing projects locally, if database connection port is not 3306, there is an Illuminate\Database\QueryException thrown on command php artisan migrate --database testing.

Screenshot 2022-06-26 at 21 04 11

@particleflux
Copy link

Indeed, the testing db config seems to be missing a functionality to set the port via .env.

monica/config/database.php

Lines 99 to 111 in 7c8105c

'testing' => [
'driver' => env('DB_TEST_DRIVER', 'mysql'),
'host' => env('DB_TEST_HOST'),
'unix_socket' => env('DB_TEST_UNIX_SOCKET', ''),
'database' => env('DB_TEST_DATABASE'),
'username' => env('DB_TEST_USERNAME'),
'password' => env('DB_TEST_PASSWORD'),
'charset' => env('DB_USE_UTF8MB4', true) ? 'utf8mb4' : 'utf8',
'collation' => env('DB_USE_UTF8MB4', true) ? 'utf8mb4_unicode_ci' : 'utf8_unicode_ci',
'prefix' => env('DB_TEST_PREFIX', ''),
'prefix_indexes' => true,
'strict' => false,
],

monica/.env.example

Lines 43 to 46 in 7c8105c

DB_TEST_HOST=127.0.0.1
DB_TEST_DATABASE=monica_test
DB_TEST_USERNAME=homestead
DB_TEST_PASSWORD=secret

Probably a rather easy fix

particleflux added a commit to particleflux/monica that referenced this issue Jul 20, 2022
The `testing` database used for the tests had no way to configure a db
server port. It always used some default fallback port (probably of the
pdo driver).

Added the `port` config setting with a new env variable `DB_TEST_PORT`.

Fixes monicahq#6200
particleflux added a commit to particleflux/monica that referenced this issue Jul 20, 2022
The `testing` database used for the tests had no way to configure a db
server port. It always used some default fallback port (probably of the
pdo driver).

Added the `port` config setting with a new env variable `DB_TEST_PORT`.

Fixes monicahq#6200
djaiss pushed a commit that referenced this issue Jul 23, 2022
The `testing` database used for the tests had no way to configure a db
server port. It always used some default fallback port (probably of the
pdo driver).

Added the `port` config setting with a new env variable `DB_TEST_PORT`.

Fixes #6200
@github-actions
Copy link

🎉 This issue has been resolved in version 4.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Copy link

This issue has been automatically locked since there
has not been any recent activity after it was closed.
Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 31, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants