Support the ongoing development of Laravel.io →
Configuration Database Packages
Last updated 1 year ago.
0
Solution

In your database do you have a migrations table?

The migrations table is what laravel uses to track what migrations have been run and such. If this table is deleted then laravel will assume no migrations have ever been run and will start from the top.

0

iWader said:

In your database do you have a migrations table?

The migrations table is what laravel uses to track what migrations have been run and such. If this table is deleted then laravel will assume no migrations have ever been run and will start from the top.

Thanks sir, migration is clear to me. if i have to create an another table migration is not a solution. migration is used for create table in your database for once.

0

Migration is for creating db tables and columns, for editing/updating/adding db tables and columns. That being said, I suspect that you might have done something wrong or the migration has gone wrong in the past. It is not a 100% sure thing and mistakes happen...

If you do not have (a lot of) data in your db table, I would suggest to use

php artisan migrate:reset

then check that the db table is really removed (it sometimes does not drop tables). After that, you simply run migration again.

php artisan migrate

If you do have (a lot of) data in your db table, you may temporarily remove all but the last file in your database/migrations/ folder and then run "php artisan migrate", but I can not really recommend it. The mess that is your migration will still be there and it is thus not the way to go.

Finally, please post the exact message you get when running migration. And maybe you could post the first migration file and the one you are trying to add?

0

Thanks guys, :) lesson learned

0

Sign in to participate in this thread!

Eventy

Your banner here too?

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.