Safely remove migration In Laravel

前端 未结 9 1771
天涯浪人
天涯浪人 2021-01-29 17:46

In Laravel, there appears to be a command for creating a migration, but not removing.

Create migration command:

php artisan migrate:make create_users_tab         


        
9条回答
  •  孤街浪徒
    2021-01-29 18:13

     php artisan migrate:fresh
    

    Should do the job, if you are in development and the desired outcome is to start all over.

    In production, that maybe not the desired thing, so you should be adverted. (The migrate:fresh command will drop all tables from the database and then execute the migrate command).

提交回复
热议问题