Rollback a specific migration in laravel5

Viewed 14942

I need to rollback a specific table as I forgot to mention foreign key. and I dont want my data loss from all tables.

My framework is Laravel 5.4

Thanks in Advance Everyone

4 Answers

I do it this way:

  1. Deleting a table manually;
  2. Going to "migrations" table and deleting corresponding row to your migration;
  3. php artisan migrate;
  4. done

For example, if you modified migration called "Settings", then you delete this table from DB and migrations table, then rerun artisan command.

You can do

php artisan migrate:rollback --path=/database/migrations/your_file.php

Related