#How to drop ONLY one table

12 messages · Page 1 of 1 (latest)

ancient lintel
#

Hello, I have a seeder for countries and cities in my code that I have to wait for 10 minutes on every php artisan migrate:fresh --seed, so is there any chance just to drop and migrate again the users table?
Thanks.

ruby whale
#

Then migrate again

#

And just seed your users data.

#

Or you could use the —step flag, but I’m not entirely sure how it works, never actually used it.

vapid breach
#

--step just specifies the number of migrations to rollback, no matter the batch number.

#

So if you only want to rollback the last two migrations, you’d use --step=2

ancient lintel
#

Okay because I have foreingId's to users, how can I do the opposite logic, because it doesn't give me to drop it because it is ->constrained(). So the final question is how to migrate:fresh the whole database except some tables?

vapid breach
#

So the final question is how to migrate:fresh the whole database except some tables?
You can’t. That’s not how migrations work.

ruby whale
vapid breach
#

@ancient lintel I think you need to fix the problems here; not the symptoms.

#

The problem is, seeding takes too long. So fix that. Not trying to come up with weird workarounds.