1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Laravel+Dockerで「Migration table not found.」を解決する

Posted at

LaravelとDocker(nginx, phpfpm, mysql)で開発をしていると、Migration table not found.という未知のエラーに遭遇してびっくりしたというお話をします。

エラーが出た経緯

急にエラーが発生しました。僕はびっくりしました。

Dockerコンテナの中でmigrateするため、こんなコマンドを打ちました

$  docker-compose exec phpfpm sh -c 'cd ../ && php artisan migrate
Migration table not found. 

まさかのMigration Table not found

初めてのエラーに驚きを隠せません。

そして、調べても日本語の資料が全くありません。。。

$  docker-compose exec phpfpm sh -c 'cd ../ && php artisan migrate:status
Migration table not found. 
$  docker-compose exec phpfpm sh -c 'cd ../ && php artisan migrate:install
Migration table not found. 

何をしてもエラーが出ます。

解決策

php artisan migrate:refreshをすると、なぜかエラーがなくなりました!

$  docker-compose exec phpfpm sh -c 'cd ../ && php artisan migrate:refresh
Migration table not found.                                                                                                             
Migration table created successfully.                                                                                                  
Migrating: 2014_10_12_000000_create_users_table

原因もなぜ治ったのかも全くわかりませんが、治って万々歳です!!

同じ境遇の方がいましたら、ぜひやってみてください!!

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?