Laravel 5.4 Specific Table Migration

前端 未结 21 1529
梦如初夏
梦如初夏 2020-12-07 10:38

Hi read all the included documentation here in https://laravel.com/docs/5.4/migrations.

Is there a way on how to migrate a certain migration file (1 migration only),

21条回答
  •  广开言路
    2020-12-07 11:00

    You need to put the file(s) into a new directory (ex:selected) and then apply

    php artisan migrate  --path=/database/migrations/selected
    

    if you need rollback:

    php artisan migrate:rollback  --path=/database/migrations/selected
    

    Note:

    php artisan migrate:refresh
    

    this will rollback and then migrate all the migrations files in the default directory (/database/migrations)

提交回复
热议问题