Support the ongoing development of Laravel.io →
Configuration Input Database
Last updated 2 years ago.
0

It says

 'article' already exists ....

If you have no data in your table you can drop it then try to migrate again.

0

First of all drop table article and just a typo tip it should be 'articles'.

Then got to the migrations table delete the entry that contains the migration name of the article you have made.

After that run php artisan migrate. It will remigrate that table.

0

thank you but now after "php artisan migrate" show below error and create table:



  [Illuminate\Database\QueryException]
  SQLSTATE[42S21]: Column already exists: 1060 Duplicate column name 'pic' (SQL: alte
  r table `article` add `pic` varchar(255) not null)






  [PDOException]
  SQLSTATE[42S21]: Column already exists: 1060 Duplicate column name 'pic'


0

If you want to alter table and add a new field simply delete that field.

0

sorry for my bad english..

we always create migtations with "Plural" name...it's laravel convention like , if you are creating article migration then run command like

php artisan make:migration create_articles_table. this command will create "articles " table in your database. Now , if you are creating a Model named "Article"..it will automatically creates a table named "articles"..now one thing is to notice here is we have already a article table in our database so model Article will do nothing because articles named table is there..

do like this..this will sure help you because same problem was with me and i overcome that by this way ..

0

Sign in to participate in this thread!

Eventy

Your banner here too?

omidnikrah omidnikrah Joined 15 Jul 2015

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.