Rollback one specific migration in Laravel

前端 未结 19 1780
梦毁少年i
梦毁少年i 2020-12-02 04:14

I want

to rollback only :

Rolled back: 2015_05_15_195423_alter_table_web_directories


I run

php artisan migrate:roll

19条回答
  •  广开言路
    2020-12-02 04:49

    If you want modify original migration file and migrate it again, you can use this package to migrate. (Applicable to Laravel 5.4 or later)

    First, install package in your Laravel project:

    composer require caloskao/migrate-specific
    

    Register command at app/Console/Kernel.php :

    protected $commands = [
        \CalosKao\MigrateSpecific::class
    ];
    

    Now, run this command to migrate your file

    php artisan migrate:specific database/migrations/table.php
    

提交回复
热议问题