16

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)

Bananaapple
  • 2,984
  • 2
  • 25
  • 38

2 Answers2

27

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.

yceruto
  • 9,230
  • 5
  • 38
  • 65
Bananaapple
  • 2,984
  • 2
  • 25
  • 38
0

i usually just call status, which shows if there any new ones. If so then I call migrate, and it runs all the new ones. See Docs here http://docs.doctrine-project.org/projects/doctrine-migrations/en/latest/reference/introduction.html

delboy1978uk
  • 12,118
  • 2
  • 21
  • 39