Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

charlesbannister@gmail.com's avatar

Laravel is trying to run a migration which doesn't exist

I have a migration named 2019_10_03_000001_create_customer_columns.

When I run php artisan migrate I get an error:

Migrating: 2019_05_03_000001_create_customer_columns ... Column already exists: 1060 Duplicate column name 'stripe_id'

Note how it's trying to run a migration with a different timestamp. I've searched and the migration with the 05 timestamp does not exist anywhere.

I've tried:

composer dump

composer dumpautoload

php artisan optimize

php artisan cache:clear

php artisan config:clear

Then I've tried updating the real file with an if table exists check but I get the exact same error.

I've searched everywhere and the only person with the same issue fixed it with composer dump-autoload

What the fucks going on!?

Note this is a live, production database so I can't start again. It's happening locally too though.

I'd share the code but, you know, the file doesn't exist.

0 likes
5 replies
charlesbannister@gmail.com's avatar

Thanks for the prompt reply however, that line of code is already in AppServiceProvider.

I'll have a look at the docs you linked and see if I can find anything else.

Edit: it looks like that's about it for that solution!

charlesbannister@gmail.com's avatar

I'm afraid the code you suggested was already in my AppServiceProvider so no cigar.

That's definitely pointed me in the right direction though. I'll respond if I figure it out.

Thanks

charlesbannister@gmail.com's avatar

Okay so, I couldn't properly figure this out so I just manually added the migrations to the migrations table. Strange one!

Thanks @sti3bas

aullah's avatar

Thanks for that @sti3bas! That did the trick in my case, although I'm not using Cashier directly, it's being called as a dependency for Laravel Spark.

I did update my application to Laravel 6 and Spark 9 a few months back and hadn't noticed this migrations issue before.

Thanks a bunch again!

1 like

Please or to participate in this conversation.