cancel
Showing results for 
Search instead for 
Did you mean: 

Grails DB migrations

chewbacca
Champ in-the-making
Champ in-the-making
We picked up the sql files from activiti jar to create the tables, but the team's getting annoyed to do the manual drop-create every time they need reset the base, so I was instructed to configure the auto-migrations in our grails project, but no matter which way I do it, activiti looks for the base before migrations runs, I'd tried to configure migrations to run sql, I'd tried to generate changelog from a healthy cleaned database, but every time I run the project it claims for the ACT_GE_PROPERTY table which runs a SELECT.

How an I make activiti runs after Grails DB migrations, or make activiti drop-create the base correctly?

Thanks,
1 REPLY 1

chewbacca
Champ in-the-making
Champ in-the-making
I solved the problem setting deploymentResources to null, then processEngine doesn't require the base, then migrations works, however it requires processEngineConfiguration.autoDeployResources(processEngine) to be called on BootStrap after restore the original deploymentResources!

Something like that on BootStrap.init:
<code>grailsApplication.config.activiti.deploymentResources = grailsApplication.config.activiti.deploymentResourcesBackup
def resolver = new PathMatchingResourcePatternResolver(grailsApplication.mainContext)
def resources = []
grailsApplication.config.activiti.deploymentResources.each { deployResource ->
resources.addAll(resolver.getResources(deployResource))
}
processEngineConfiguration.setDeploymentResources(resources.toArray(new Resource[resources.size]))
processEngineConfiguration.autoDeployResources(processEngine)</code>