kumarshantanu / clj-liquibase

Clojure wrapper for Liquibase for database change management and migration
48 stars 8 forks source link

documentation for preconditions in EDN #10

Open timclemons opened 8 years ago

timclemons commented 8 years ago

Having an example or two of how to create preconditions, including onFail actions, would be extremely helpful.

timclemons commented 8 years ago

Any thoughts on this? Should this project still be considered under development?

kumarshantanu commented 8 years ago

@timclemons Hi, and sorry for a late reply. I would welcome a pull request to include a pre-conditiion example. I have had limited time of late, but I will try to gather some time for this in case I don't see any pull request.

timclemons commented 8 years ago

I'm certainly willing to submit a pull request, but at the moment I'm trying to reverse engineer how exactly preconditions work in an EDN file.

There's one example file I found with a commented precondition at liquibase-edn:

https://github.com/kumarshantanu/liquibase-edn/blob/master/src/test/resources/example.edn

There it has the following:

"preConditions" [{"runningAs" {"username" "liquibase"}}]}

Presumably, the camel case string keys can be replaced with hypen-separated keywords:

:pre-conditions [{:running-as {:username "liquibase"}}]

Still trying to confirm the above works, as it doesn't throw any exceptions in the parser, but still doesn't seem to perform a precondition check. I'm also trying to fill in how the following use cases are structured in EDN:

Any insight would be very much appreciated.