Multiple contexts not recognized in formatted SQL when using AND
Description
Environment
Linux Mint, running Liquibase using Ant, JDK 7
Activity
Show:
Nathan Voxland March 14, 2016 at 8:09 PM
Fixed in 3.5.0, although you need to put quotes around the contexts.
--changeset lfi:CreateTable_SOME_TABLE context:"tag1 and tag2"
Fixed
Details
Details
Reporter
Lukáš Fiala
Lukáš FialaComponents
Fix versions
Affects versions
Priority
Created February 8, 2016 at 10:14 AM
Updated March 14, 2016 at 8:09 PM
Resolved March 14, 2016 at 8:09 PM
I have an annotated SQL changelog where changesets have two contexts with the AND operator.
--changeset lfi:CreateTable_SOME_TABLE context:tag1 and tag2
I need such changeset to run only when both contexts are specified at runtime. However, the second context is ignored by Liquibase. If I wrap the whole "tag1 and tag2" in quotes, no keyword is recognized and the changeset does not run at all.
Apparently it's an issue with parsing the SQL annotations. It works in XML.
See also https://liquibase.jira.com/browse/CORE-1184#icft=CORE-1184