0

I've got specific issue, when in building my project, I need to run migration only if it wasn't migrated yet. I know that I can use $this->skipIf() inside of migration, but I wanted to have some "external" way to do it, without adding code in every class that I want to run like that.

Is there any way to do it? Flag or something? Tried different things with :execute and :migrate but no result.

  • That should not be necessary. Usually doctrine uses the version table to keep track of which migrations already where executed . – simon.ro Jun 24 '20 at 20:14
  • That's true, but in this specific case, I must execute migrations when db is empty, or NOT execute them if they're marked as executed in migrations table. And the problem is, that if I try to execute older migration, it's executed always, not only if was not executed yet. – rallyholic Jun 25 '20 at 07:11

0 Answers0