Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Execute next / previous migration with doctrine migrations using symfony 3

I know that I can run specific migrations using execute with up / down and version number, ie

doctrine:migrations:execute YYYYMMDDHHMMSS --down

My question then - is there an easier way to simply run the next or previous migration without having to look up version numbers?

Ideally I would like something like

doctrine:migrations:execute --down n

Where n is the number of migrations to run from current in the specified direction.

(same idea as rake db:rollback STEP=n)

like image 332
Bananaapple Avatar asked Aug 18 '17 11:08

Bananaapple


1 Answers

Closest thing to what I was looking for is:

doctrine:migrations:migrate prev

doctrine:migrations:migrate next

These cannot be used in conjunction with n though, so if you want to do more than 1 you need to use doctrine:migrations:migrate with the version number you want to go to.

like image 76
Bananaapple Avatar answered Oct 09 '22 18:10

Bananaapple