Application extended with method to check and install all missing migrations, not only newer ones#137
Application extended with method to check and install all missing migrations, not only newer ones#137moroz1999 wants to merge 1 commit intodavedevelopment:masterfrom
Conversation
…rations, not only newer ones
|
Doesn't the migrate command do this already? |
|
The only method in PhpmigApplication to install migrations is PhpmigApplication::up, which takes the timestamp (version) of the last installed migration and installs everything with a bigger timestamp (version). |
|
The MigrateCommand should do this, unless I've misunderstood your problem. Here's a screencap of it on my app: |
|
We are using PHPMig not from CLI, but by sending HTTP request to PHP script. This PHP script makes an instance of PhpmigApplication to install the missing updates. PhpmigApplication doesn't have the exact "migrate" command functionality, as in the CLI, it doesn't check the older missing migrations. This is exactly what's been added by our commit. |

At the moment if some migrations are not installed, application can miss them if they have an older timestamp than the last installed migration. This can easily happen when a team works on different features having different migrations alltogether, and periodically feature branches get merged into master.