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 tableclients
(id
int unsigned not null auto_increment Primary key,name
varchar(255) not null,responsible
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.
The table
clients
already exists, so it cannot run the Migration to create the tableclients
, delete the table of your bank that has worked normally.– RFL
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 usmigrate
that already comes in the Laravel?– novic
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'
– Danilo Rodrigues
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.
– Evert