A
A
Alexander Sharomet2016-10-13 14:02:38
Laravel
Alexander Sharomet, 2016-10-13 14:02:38

How to roll back a certain minration in laravel 5?

Hi all.
Tell me how in laravel 5 + you can roll back a specific migration?

php artisan migrate:rollback //откат последней миграции
php artisan migrate:reset //откат всех миграций

php artisan migrate:rollback create_users_table //Пробовал вот такой способ не получилось

Thank you.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexander Aksentiev, 2016-10-13
@sharomet

you can't roll back a random migration from the middle of a project.
Only all/one/several from the end. (Laravel 5.3 added rollback of multiple)

V
Vyacheslav Plisko, 2016-10-13
@AmdY

Get used to writing as if migrations cannot be rolled back at all. If you need to fix something, then create a new migration that cancels the changes of the previous one.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question