Please open a ticket over at http://jira.codehaus.org/browse/GRAILSPLUGINS/component/13540
~~ Robert Fischer.
Grails Training http://GroovyMag.com/training
Smokejumper Consulting http://SmokejumperIT.com
Enfranchised Mind Blog http://EnfranchisedMind.com/blog
Check out my book, "Grails Persistence with GORM and GSQL"!
http://www.smokejumperit.com/redirect.html
> If we were to get preconditions working on the databaseChangeLog node,
> an elegant way of solving the initial problem of preventing migrations
> from running under certain conditions would be to write a custom
> precondition "dbCreateSetting(mode:'update')". Since we already have
> boolean operators for the preconditions, this would enable us to do
> "not { dbCreateSetting(mode: 'create-drop') }" or:
>
> or {
> dbCreateSetting(mode: 'update')
> dbCreateSetting(mode: 'create')
> }
>
> etc. Just a thought...
>
That's a good idea. There's a number of these kinds of Grails-specific preconditions that I'd like
to get out there -- domainHasProperty and grailsEnv are the two topping my list.
> Oh and while I'm at it, a couple of questions:
>
> 1. What subset of the grails application/configuration/etc objects do
> we have access to from the context of the executing changelog
> scripts?
>
I documented that...somewhere...
Not on the wiki. Crap.
I'll have to research that for you and get back to you.
> 2. A somewhat fuzzy one...isn't exactly crystal in my mind yet, but
> here goes. What is the contract between the liquibase dsl artifacts
> and general groovy code. For example, if I were to write a
>
> file.eachFileRecurse { f -->
> include(<somefunctionof_f> + "myMigration.groovy)
> ...
> }
>
> would that work? Same for migrations and especially for preconditions.
> I would for example want to be able to do a precondition which loops
> over a set of table names and checks for existense of a specific
> column on any one of them.
>
Yes, that would work.
That I *did* do some documentation on:
http://wiki.github.com/RobertFischer/autobase/groovy-in-migration-files
Be aware that if you produce a distinct change set compared to a previous run, Liquibase will
attempt to apply the change set again in a fit of helpfulness.
> Also, not sure if I'll have the time, but would you mind if I started
> a new page with example usages for all the liquibase refactorings in
> autobase dsl on your github wiki. Not sure if I'd go as far as call it
> a reference, but some more detail wouldn't hurt. Seems like you get a
> boatload of questions on syntax and I think a few extra pages might
> lower the barrier of entry.
>
Please do.
~~ Robert Fischer.
Grails Training http://GroovyMag.com/training
Smokejumper Consulting http://SmokejumperIT.com
Enfranchised Mind Blog http://EnfranchisedMind.com/blog