Reputation: 2973
I'm trying to migrate some database tables in my Laravel application. I'm using a third party library https://github.com/spatie/laravel-schedule-monitor which seems to break and requires re-migrating when upgrading. If I run php artisan migrate:fresh
locally it'll work just fine, but amongst all of my other migrations I don't want to overwrite and dump the data in my other tables in a production environment.
I want to migrate:fresh
a specific migration...
UPDATE
When trying to run the refresh
command on a table, the below happens...
Upvotes: 1
Views: 4581
Reputation: 636
another solution is to copy whats inside that migration and delete it and re-make that migration and paste data to that and run php artisan migrate
dont forget to dlete the table from phpmyadmin also
Upvotes: 3
Reputation: 12401
you can use php artisan migrate:refresh --path=
example
php artisan migrate:refresh --path=database/migrations/2020_09_02_000000_create_users_table.php
if you need rollback:
php artisan migrate:rollback --path=/database/migrations/2020_09_02_000000_create_users_table.php
Upvotes: 4