Problem with migrate from Laravel?

Asked

Viewed 487 times

0

I just installed Laravel on my pc to learn a little bit. But I’m having a little problem using the migrate. Every time I try to use the migrate, it presents the following error:

[Illuminate Database Queryexception]
SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'clients' already exists (SQL: create table clients (id int unsigned not null auto_increment Primary key, name varchar(255) not null, responsible varchar(255) not null, email varchar(255) not null, phone varchar(255) not null, address text not null, obs text not nul l, created_at timestamp null, updated_at timestamp null) default Character set utf8mb4 collate utf8mb4_unicode_ci)

He ends up not generating the new migrations which I created, however, when I change the date of a migration for an earlier date, it works.

Erro no migrate

  • The table clients already exists, so it cannot run the Migration to create the table clients, delete the table of your bank that has worked normally.

  • Have to see what you did! Type maybe table names that already exist, because clients must be you who created? You have by chance changed some things in us migrate that already comes in the Laravel?

  • I didn’t change anything. The table exists because I changed the date and migrate worked. But before I changed the date, it just didn’t work. It was like he just counted 'users'

  • In Laravel if there is an error in the table to be created the migrate can’t give a rollback delete the database and create again and run php Artisan migrate. If you have any error it will show you which file is the error of your migration.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.