Skip to content

Commit

Permalink
Make rollbackVersion a string and compare using distutils.version.Loo…
Browse files Browse the repository at this point in the history
…seVersion
  • Loading branch information
hbogaards committed Jan 6, 2016
1 parent 0eb70f7 commit 58624c5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/main/resources/liquibase/rule.py
Expand Up @@ -4,6 +4,8 @@
# FOR A PARTICULAR PURPOSE. THIS CODE AND INFORMATION ARE NOT SUPPORTED BY XEBIALABS.
#

from distutils.version import LooseVersion

DESTROY_RESOURCES = 40
CREATE_RESOURCES = 60

Expand Down Expand Up @@ -38,7 +40,7 @@ def handle_destroy(d, ctx):
ctx.addStep(step)

def handle_modify(pd, d, ctx):
if d.rollbackVersion < pd.rollbackVersion:
if LooseVersion(d.rollbackVersion) < LooseVersion(pd.rollbackVersion):
step = steps.jython(description="Rollback to tag [v%s] in liquibase [%s]" % (d.rollbackVersion, d.container.name),
order=DESTROY_RESOURCES,
script='liquibase/apply_rollback.py',
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/synthetic.xml
Expand Up @@ -11,7 +11,7 @@
<type type="liquibase.ExecutedChangelog" extends="udm.BaseDeployedArtifact" deployable-type="liquibase.Changelog" container-type="liquibase.Runner" description="Executed liquibase changelog">
<generate-deployable type="liquibase.Changelog" extends="udm.BaseDeployableFolderArtifact" />
<property name="changeLogFile"/>
<property name="rollbackVersion" kind="integer"/>
<property name="rollbackVersion" />
<property name="baseRollbackTag" default="xld_liquibase_base_version" hidden="true"/>
</type>

Expand Down

0 comments on commit 58624c5

Please sign in to comment.