Matt Follett

Grails/DatabaseMigrationPlugin/Liquibase Quirk

I just fought with this for a while and figured I’d record this in the vast internets in case others come across this. While attempting to extend the functionality of our Grails project at work I needed to add a new table and related foreign key constraints. We use the Grails Database Migration Plugin which uses liquibase to keep our schema in sync between production, staging, and development boxes. I declared a foreign key constraint similar to this one:

and got this exception:

It turns out that passing in a named parameter of referencesUniqueColumn with a value of anything other than false causes this exception. This wasn’t immediately obvious to me and I still don’t know why, but I thought I’d note it in case someone else ran into it too.