Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

"diff" algorithm #252

pmarking opened this Issue Jan 6, 2012 · 2 comments


None yet
2 participants

pmarking commented Jan 6, 2012

It currently seems that if I run 'propel-gen diff' twice in a row without migrating in between, I will get duplicate migration information, the second of which will usually fail. Wouldn't it make sense for the 'diff' command to do the following:

  1. Check the database for the last committed migration (LCM) class/file.
  2. Check the directory against that LCM for any uncommitted migration classes/files. If any are found, the diff should fail with a message to the effect that 'Uncommitted migrations have been found; please either commit or delete them before rerunning 'diff'.

Wouldn't that make more sense, or am I misunderstanding the use of the diff and migrate commands?


fzaninotto commented Jan 7, 2012

That's by design. As long as a diff isn't migrated, it's not taken into account. You just mustn't call diff twice without migrating before.

So the check you recommend makes sense, would you like to work on a patch ?

pmarking commented Jan 8, 2012

Thank you.

I tried to see if it's something I could patch on my own, but I'm entirely unfamiliar with phing and some of the other tools that seem to be in play with this, so I have to respectfully (and quite humbly!) bow out. As you said, though, it does make sense, so hopefully someone with the expertise can patch that in much more adeptly than I ever could!

Side note: I've been using Propel for about a month now and I am absolutely loving it, and have to commend you greatly on such an amazing project. Some of the huge queries I've been writing have been quite challenging, but so far I've been able to put them all together in Propel without having to resort to manually building any sql queries!

willdurand added a commit that referenced this issue Mar 5, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment