【问题标题】:Laravel reduce migration filesLaravel 减少迁移文件
【发布时间】:2021-01-10 17:01:45
【问题描述】:

我有一个使用数据库的 Laravel 应用程序。数据库很大,由许多迁移文件生成。有没有办法减少迁移文件的数量,让每个表都有一个迁移文件?另外,迁移文件过多会导致某些结果吗?像性能问题?

【问题讨论】:

    标签: laravel database-migration


    【解决方案1】:

    如果你有 laravel 8 你可以使用squashing-migrations

    通过运行php artisan schema:dump cmd

    参考链接https://laravel.com/docs/8.x/migrations#squashing-migrations

    对于旧版本你可以试试这个

    https://github.com/Cytracom/laravel-migration-squasher

    或者你可以试试这个 Laravel 5.5 Consolidate migrations w/ production database

    【讨论】:

    • 不,很遗憾,它是 5.7
    猜你喜欢
    • 2017-09-18
    • 2021-09-24
    • 2018-01-10
    • 1970-01-01
    • 2016-06-12
    • 2020-08-28
    • 1970-01-01
    • 2018-03-09
    • 2015-08-08
    相关资源
    最近更新 更多