LoginSignup
1
0

More than 3 years have passed since last update.

Laravel の artisan package:discover で database error した時のメモ

Posted at

laravelを初めてherokuにデプロイする際に少しハマったのでメモ
PackageInstallの後のGenerating optimized autoload filesで下記のエラー

Illuminate\Foundation\ComposerScripts::postAutoloadDump
remote:        > @php artisan package:discover --ansi
remote:
remote:        In Connection.php line 664:
remote:
remote:          SQLSTATE[42P01]: Undefined table: 7 ERROR:  relation "******" does not exist

migrateしてないのでテーブルが見つからないのは当たり前なのだが。
調べたら ViewServiceProvicer の boot() で該当するテーブルの処理が問題らしいので一時的にコメントアウトしてデプロイー>migrateー>コメントを解除してデプロイで対応。

if(Schema::hasTable('users')) {}で対応したほうが良かったかもしれないが未検証。

1
0
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
0