Laravel 5 Migrate Base table or view not found: 1146

前端 未结 12 615
情话喂你
情话喂你 2020-12-11 01:06

I am in big problem. I am trying to rum php artisan migrate to generate table migration, but i am getting

[2016-03-08 05:49:01] local.ERR

12条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-11 01:59

    The problem is that the foreign keys are added but cannot find the table because it hasn't been created.

    1) make tables without foreign keys

    2) Make a 9999_99_99_999999_create_foreign_keys.php file

    3) put there the foreign keys you want. With the 999..9 .php file it makes sure that it does the foreign keys last after the tables have been made.

    4) You have added the tables first and then added the foreign keys. This will work.

提交回复
热议问题