简体   繁体   中英

rollback module migration in Laravel?

I've run migration for a laravel module by

php artisan module:migrate

Then I wanted a rollback, so I've tried

php artisan module:rollback

There was no such command so I tried

php artisan migrate:rollback

But Laravel doesn't see it:

 [Symfony\Component\Debug\Exception\FatalThrowableError]
 Class 'AddInteractionsToVisits' not found

Am I doing something wrong? Is there a way to rollback module migration?

Since you're using a package, you should check their docs.

php artisan module:migrate-rollback Module

Check here https://nwidart.com/laravel-modules/v1/advanced-tools/artisan-commands

And if you need to rollback specific migration from module you can do this.

php artisan migrate:rollback --path=Modules/YourModule/database/migrations/2020_05_15_xxxxxx_create_your_table.php

I have use this code here instead Module doc code since it's giving an error.

php artisan migrate:rollback --path=... 

And remember, If you are using linux servers careful about case sensitivity. You have to add like /Database/Migrations with starting capital.

/Database/Migrations/2020_05_15_xxxxxx_create_your_table.php

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM