为什么Laravel迁移:新鲜需要很长时间才能花422张桌子?
我有一个Laravel项目,每次我想创建一个新项目时,
php artisan migrate:fresh
它都可以正常运行,但是经过3年的工作,我已经到达了422个表,现在我想开始迁移至少需要将近5到10分钟才能完成迁移工作。
我可以在localhost
中毫无问题地等待,但是我最大的问题是当我使用 > LaravelInstaller 库为项目添加一个安装程序。
它需要很长时间,最终返回下一个错误
内部服务器错误500
因此,为了使此安装在如此长的持续时间内工作,我必须在php.ini
中更改最大时间限制
以解决此问题。
有什么办法可以加快迁移的速度?
谢谢
I have a Laravel project and I'm using this command to migrate a database every time I want to create a new project
php artisan migrate:fresh
It was working fine, but after 3 years of working on it I've reached 422 tables and now when I want to migrate it takes almost 5 to 10 minutes at least to complete a migrate job.
I can wait without problems in localhost
, but my biggest problem is when I use the LaravelInstaller
library to add an installer feature to the project.
It takes a long time and eventually it returns the next error
internal server error 500
So in order to make this installation work with such long durations, I have to change Max time limit
in php.ini
to solve this issue.
Is there any way to speed up the migration?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这是对加速问题的答案,而不是
内部服务器错误500
,因为没有与引起该错误的问题有关的任何详细信息。我假设您至少使用
Laravel 8
,基于您可以尝试schema dump
,它添加到创建当前架构的转储中。这是命令:
您有一个问题仅仅是因为您已经创建了大量的迁移文件列表,在这种情况下,通常,进行迁移:新鲜不应该花太多时间,即使对于
422 < /code>表,但是您遇到了这个问题,因为重复此过程并使列表在几年中更大。
这是参考的链接
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 trySchema Dump
, which It's added to creates a dump of the current schema.Here's the command :
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