hi i have laravel project and im using this command to migrate database every time i want to create new project
php artisan migrate:fresh
its working fine in the first of working but after 3 years of working i have like 422 table
and now whan i want to migrate its tack like 5 to 10 min to complete and thats long long time
in localhost i can wait no problem ..
but my biggest problem thats i use library to install laravel like this one
https://github.com/rashidlaasri/LaravelInstaller
when i run install its tack long time and return
internal server error 500
after excuted max time every time i give the script to the team member to install it i have to change the
php.ini max time limit
is there any way to speed up the migrate ?
thanks
>Solution :
This is an answer to speed-up issue, not internal server error 500
, because there’s not any details related to issue that causing that error.
I’m assuming you’re using Laravel 8
at least, and base on that you can try Schema Dump
, which It’s added to creates a dump of the current schema.
Here’s the command :
php artisan schema:dump
# This one is taken from below link, in case of more help, don't hesitate
# to read the docs
# Dump the current database schema and prune all existing migrations...
php artisan schema:dump --prune
You have this issue simply because you’ve a huge list of migration files that were created, and in this case, in general, doing a migration:fresh should not take so much time, even for 422
table, but you have this issues, because of repeating this process and make list bigger in years.
Here’s the link to reference