#How to drop ONLY one table
12 messages · Page 1 of 1 (latest)
php artisan migrate:rollback --path=/database/migrations/2014_10_12_000000_create_users_table.php
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.
--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
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?
So the final question is how to migrate:fresh the whole database except some tables?
You can’t. That’s not how migrations work.
I would probably just go to TablePlus & manually delete the tables you want to refresh, delete the rows for these tables in the migrations table & then run migrations again & just seed tables you re-migrated.