EnvironmentContext.get_revision_arguments() and EnvironmentContext.get_head_revisions() returns incorrect values #482
Comments
Dimitry Lukashov wrote: PS I tried to submit a pull request and got a |
Michael Bayer (@zzzeek) wrote: bitbucket's pull request feature gave you that error? I also don't accept PRs without tests in any case. it appears that get_head_revisions() was added without any tests at that time. there is no get_revision_arguments() method so I don't know what you're referring to (there's a get_revision_argument() method, which I don't see how that is related - test cases tell all, thanks). |
Michael Bayer (@zzzeek) wrote: get_head_revisions() returning a tuple in all cases is going to break an application that expected this to be a straight string earlier, even though it is documented as returning a tuple. Hopefully this will not have a large impact as the method is entirely wrong right now returning a scalar value. |
Michael Bayer (@zzzeek) wrote: |
Michael Bayer (@zzzeek) wrote: Repair as_revision_number to return a tuple for "heads" Fixed bug where the :meth: Change-Id: I085d9b6c3f4ceafd6828d24983768a3d3916ce00 → 3c726b2 |
Changes by Michael Bayer (@zzzeek):
|
Dimitry Lukashov wrote: @zzzeek thank you very much! Do you normally allow others to PR, if yes, then it must be a problem on my end. Next time I will add test cases! |
Fixed bug where the :meth:`.Script.as_revision_number` method did not accommodate for the 'heads' identifier, which in turn caused the :meth:`.EnvironmentContext.get_head_revisions` and :meth:`.EnvironmentContext.get_revision_argument` methods to be not usable when multiple heads were present. The :meth:.`EnvironmentContext.get_head_revisions` method returns a tuple in all cases as documented. Change-Id: I085d9b6c3f4ceafd6828d24983768a3d3916ce00 Fixes: sqlalchemy#482
Fixed bug where the :meth:`.Script.as_revision_number` method did not accommodate for the 'heads' identifier, which in turn caused the :meth:`.EnvironmentContext.get_head_revisions` and :meth:`.EnvironmentContext.get_revision_argument` methods to be not usable when multiple heads were present. The :meth:.`EnvironmentContext.get_head_revisions` method returns a tuple in all cases as documented. Change-Id: I085d9b6c3f4ceafd6828d24983768a3d3916ce00 Fixes: sqlalchemy#482
Migrated issue, originally created by Dimitry Lukashov
When there are multiple active heads and the alembic_version table has multiple records
Script.as_revision_number() should return a tuple, instead it returns only returns the hex identifier of one of the heads, making EnvironmentContext.get_head_revisions() useless and EnvironmentContext.get_revision_arguments() not very helpful when there are multiple heads.
Here is my proposed solution:
The text was updated successfully, but these errors were encountered: