-
Notifications
You must be signed in to change notification settings - Fork 11.2k
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
[5.4] Database migrations in fresh install do not work #17530
Comments
Can you add another line in
And try again. |
Apologies if I was not clear - this isn't something I need a solution to for myself, but something that is broken within the framework without first changing something. If the above fix is what is recommended then it should be in the configuration by default for new installs. However it would make more sense for something that uses |
You did not provide the error message. So, my guess was based on my experience with similar case. If this solution worked then there are two things to consider:
And yes - it probably should be mentioned in documentation. But before that we should find out if this is the case. |
Add this to your use Illuminate\Support\Facades\Schema;
public function boot()
{
Schema::defaultStringLength(191);
} |
An alternative solution for you is enabling |
Thank you all, I see the version of MariaDB I am on is slightly behind the one where the defaults have changed (10.2.2). My file format for databases is still on Antelope so I had to adjust it to allow Barracuda, and turn on |
Description:
I freshly installed Laravel 5.4 and ran the commands to generate the sessions, failed_jobs, notifications tables in the database.
The following migrations all fail to run due to the recent change from UTF8 charsetto utf8mb4. This is due to the column length on these migrations not being defined by default in a new install.
The
string
call in these migrations doesn't specify a length, so it usesBuilder::$defaultStringLength
which is currently still set to 255 causing this error and making migrations not migratable from the start without changing this value viadefaultStringLength()
method on the Builder class.The following errors are produced when running migrations:
Steps To Reproduce:
Thank you.
The text was updated successfully, but these errors were encountered: