Amrinder Singh
Amrinder Singh

Reputation: 5492

How to rollback a specific migration in Cakephp?

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.

Upvotes: 7

Views: 6221

Answers (2)

Thanh Ho Viet Vu
Thanh Ho Viet Vu

Reputation: 1

bin/cake migrations rollback -d <version-1>

Example: version is 20240523092748

Command is:

bin/cake migrations rollback -d 20240523092747

All migrations have version > 20240523092747 will rollback

Upvotes: 0

Amrinder Singh
Amrinder Singh

Reputation: 5492

Finally i got the answer,

here we go

bin/cake migrations rollback -t <version>

Thanks Anyways to SO :)

Upvotes: 7

Related Questions