简体   繁体   中英

artisan migrate results: SQLSTATE[HY000]: General error: 1005 on LUMEN / LARAVEL

I'm trying to run php artisan migrate command but I am getting the following error.
I have looked at many forums and tried several solutions but nothing solved my problem.
What is going on?

在此处输入图片说明

-

Migrations:

You can not create "produtos" table with a foreign key reference before creating "categorias" table

i suggest to change to change date in migration files name to re-order migration

so that migration of "categorias" table will run first

i hope that answered the question.

I notice that in your migration files, there are no table name cremasco.#sql-3076_1e but the error showing cannot create that table.

pls check your migration table in you database see if it has the cremasco.#sql-3076_1e . and run this in your command line :

composer dumpautoload then try again to migrate the database php artisan migrate

if the problem still exist then you need to drop your databases, and migrate again.

This problem exist because we deleted the files migration but the table migration in database still has it

.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM