When I tried to change a column in Laravel's migration, an error occurred
Thank you for your continued support.
This article contains advertisements that help fund our operations.
Table Of Contents
This is a solution for when an error occurred while trying to change a column in Laravel's migration.
Environment
Laravel6[Related article] How to create a database with Laravel (migration)
Modifying the migration file
When changing a column in Laravel,
① Install doctrine/dbal
② Add the following description to the migration file
$table->string('content',1000)->change()and execute.
Error message
When I ran the command
php artisan migrateI got the following error:
Laravel v6 is only compatible with doctrine/dbal 2, in order to use this feature you must require the package "doctrine/dbal:^2.6".Solution
The error occurred because the doctrine/dbal package version did not match.
It seems that Laravel6 requires the previous version of doctrine/dbal.
So,
Conclusion
composer require "doctrine/dbal:^2.6"This command will solve the issue!
Example that will cause problems by installing the latest version:
composer require doctrine/dbalSummary
That's all.
See you!





