はじめに
マイグレーションファイルを追加して、以下のコマンドを実行したのですが、「Nothing to migrate.」となり、マイグレーションが実行されなかったので、対処法をまとめました
$ php artisan migrate --env=testing
Nothing to migrate.
Laravelのバージョン
$ php artisan --version
Laravel Framework 5.8.29
対処法
以下のコマンドを実行して、キャッシュをクリアすることで、マイグレーションが実行されました
$ php artisan config:clear
Configuration cache cleared!
$ php artisan migrate --env=testing
Migrating: 2019_12_17_150625_create_hoges_table
Migrated: 2019_12_17_150625_create_hoges_table (0.02 seconds)
終わりに
.env.testingを更新したときは、キャッシュクリアを忘れずにしようと思います