The easiest way is to simply check the dbCreate value from config, for example:
import org.codehaus.groovy.grails.commons.ApplicationHolder
if (ApplicationHolder.application.config.dataSource.dbCreate == "create") {
...do create stuff...
} else if (ApplicationHolder.application.config.dataSource.dbCreate == "update") {
...do update stuff...
}
source
share