7

I am working on migrations in Cakephp3, I want to rollback a specific migration, I know how to rollback a previous migration by using the follow way:

bin/cake migrations rollback

But I couldn't find a way to rollback a specific migration.

Note: I am using phinx plugin for database migrations.

halfer
  • 19,824
  • 17
  • 99
  • 186
Amrinder Singh
  • 5,300
  • 12
  • 46
  • 88

1 Answers1

7

Finally i got the answer,

here we go

bin/cake migrations rollback -t <version>

Thanks Anyways to SO :)

Amrinder Singh
  • 5,300
  • 12
  • 46
  • 88
  • 1
    Doing it that way, you don't rollback a specific migration, but ALL THE MIGRATIONS UNTIL THAT ONE! – elboletaire Aug 24 '17 at 11:07
  • 1
    There's no way, AFAIK, to rollback a specific migration. The only way I've found to "re-run" (careful! to "re-run", not to rollback a specific migration) is to remove its entry in the `phinxlog` table. Edit: and run `migrate` again – elboletaire Aug 24 '17 at 11:11