Skip to content

Instantly share code, notes, and snippets.

@halfbaked
Last active December 10, 2015 00:48
Show Gist options
  • Save halfbaked/4353649 to your computer and use it in GitHub Desktop.
Save halfbaked/4353649 to your computer and use it in GitHub Desktop.
setting the location of database migration changelogs to be in a Grails plugin
import org.codehaus.groovy.grails.plugins.PluginManagerHolder
...
def doWithConfig = { config ->
// Here we need to tell the database migrations plugin the change log is in the s5-core plugin
try {
def pluginManager = PluginManagerHolder.pluginManager
def plugin = pluginManager.getGrailsPlugin('s5-core')
def pluginDir = org.codehaus.groovy.grails.plugins.GrailsPluginUtils.getPluginDirForName('s5-core')?.path
config.grails.plugin.databasemigration.changelogLocation = "$pluginDir/grails-app/migrations"
} catch (Exception e) {
println "Error in doWithConfig $e"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment