Safely remove migration In Laravel

前端 未结 9 1798
天涯浪人
天涯浪人 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:11

    I accidentally created two times create_users_table. It overrided some classes and turned rollback into ErrorException.

    What you need to do is find autoload_classmap.php in vendor/composer folder and look for the specific line of code such as

    'CreateUsersTable' => $baseDir . '/app/database/migrations/2013_07_04_014051_create_users_table.php',
    

    and edit path. Then your rollback should be fine.

提交回复
热议问题