grails-database-migration
grails-database-migration copied to clipboard
dbm should run before quartz/schwartz plugins
I recently dropped my database (hadn't since Grails 3.1.x) and re-started from scratch. Quartz would not start up due to no tables being created. This was due to dbm not running before to create the tables. I disabled quarts and let it dbm run, then re-enabled quartz and all was fine.
Should this constraint go in dbm or the respective plugins? eg: https://github.com/grails-plugins/grails-quartz/blob/0e2a909936afeab9322035e1a5da84ef3700ebfd/src/main/groovy/quartz/QuartzGrailsPlugin.groovy#L49
I'm not sure making a change for loadAfter/loadBefore would have any effect, however you could give it a try locally and report back. I would think the change should go in the quartz plugin since it is the one with the issue.
You're correct - the load* list didn't change the behavior. Is there a way to ensure dbm is run early to create tables for plugins that depend on them?
I know this ticket is old, but in case anyone needs a work-around:
- Disable quartz auto-startup in application.yml/application.groovy by setting
quartz.autoStartuptofalse - Inject the
quartzSchedulerbean intoBootStrap.groovyand inside theinitclosure runquartzScheduler.start()orquartzScheduler.startDelayed().
We delay the quartz scheduler for other reasons but as far as I know both methods should work. This is how we worked around this issue.