-
Notifications
You must be signed in to change notification settings - Fork 780
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
Passport migrations ignore --database option #1370
Comments
I'm investigating this one with the team. Thanks for reporting 👍 |
We're gonna look at how we're going let the |
I can reproduce this problem in laravel 8. |
Yeah still haven't gotten to this I'm afraid. Have been knee deep into PHP 8 updates. Appreciating help with it. |
Also running into this issue. Is there a workaround (except running the tests on the default database) available to avoid this issue? |
Not atm. |
One workaround is to manually change the database config item to your testing database before running tests. If you have a database connection set up in Laravel called After running tests, be sure to uncomment the production database setting and comment out the 'testing' line.
|
I do something similar, but I prefer to change my .env file, since it won't be comitted to git. Locally I change the .env DB_DATABASE setting to the test database when I want to create/run unit tests and change it back when I'm done testing. For the build pipeline I've created a dedicated test .env file that is copied/renamed before the tests are run. |
You can fix the issue publishing the |
@driesvints: A sensible fix might be to change the out-of-the-box connection value to Line 62 in 7ab3bdb
The above copy and pasted An update to https://laravel.com/docs/passport can be done for the second case below since a userland config-based fix exists. #1255 essentially moved Passport database configuration into the migration files which overrides the CLI
|
We've reverted those changes for the next major release of Passport. At the moment we don't have a date yet for when that'll be released. |
The revert doesn't help for cases where the passport config is exported. Replacing the passport database connection defaults to null on the config file fixes it tho. |
Helped me a lot |
Description:
The included passport migrations no longer consider the --database flag passed to migrate on the command line, instead reading the default database from the connection specified in config/passport.
Steps To Reproduce:
On a new Laravel project with at two database connections in config/database (mysql and testing), run
php artisan migrate:fresh
then runphp artisan migrate:fresh --database testing
.The second migration will fail, reporting that the oauth_auth_codes_table already exists, as it is accessing the
mysql
connection instead of thetesting
connection.I believe this behavior was introduced in 555e02c on May9th.
The text was updated successfully, but these errors were encountered: