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

[11.x] Better database creation failure handling #50836

Merged
merged 3 commits into from
Mar 29, 2024

Conversation

driesvints
Copy link
Member

@driesvints driesvints commented Mar 29, 2024

Currently, when you try to migrate and your database isn't created yet, you'll be prompted to create it. However, if you choose to not do that, the migrate command will still continue to attempt to run database queries even though we know the database doesn't exists. This PR improves this flow by throwing an early exception to indicate the database couldn't be created and no subsequent queries are made anymore.

It's important to note that this PR doesn't changes behaviour as the user was already getting an exception. It's now just an informative message instead of the below query exception.

I stumbled upon this when running the Laravel installer to setup a new Jetstream app and wondered what would happen if I choose to not create the database.

Screenshot 2024-03-29 at 11 18 10

@driesvints driesvints changed the title Better database creation failure handling [11.x] Better database creation failure handling Mar 29, 2024
@driesvints driesvints requested a review from nunomaduro March 29, 2024 10:28
@taylorotwell taylorotwell merged commit aa22a81 into 11.x Mar 29, 2024
23 of 24 checks passed
@taylorotwell taylorotwell deleted the improve-database-creation branch March 29, 2024 14:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants