Skip to content

Conversation

@timacdonald
Copy link
Member

This PR is the MySQL counterpart to #43867

Screen Shot 2022-09-16 at 4 34 49 pm

# No prompt, just attempts to create the file. # If it fails the exception is shown. php artisan migrate --force # No prompt and the exception is shown. # This is the same as the current behaviour. php artisan migrate --force 
@jbrooksuk
Copy link
Member

@timacdonald what happens when the user does not have permissions to create additional databases?

if (
$e->getPrevious() instanceof PDOException &&
$e->getPrevious()->getCode() === 1049 &&
$connection->getDriverName() === 'mysql') {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why don't you create a MySQLDatabaseDoesNotExistException, instead of this if with three conditions (like SQLiteDatabaseDoesNotExistException on L.140)?

@timacdonald
Copy link
Member Author

If any failure occurs the original exception message would be shown.

@amaelftah
Copy link
Contributor

when i was moving from rails to learn laravel I was missing this suggestion ... thanks so much for adding it ❤️

@taylorotwell taylorotwell merged commit 85ca3fb into laravel:9.x Sep 16, 2022
@khalidedaig
Copy link

It's finally come true, I love that, thanks laravels

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

6 participants