I\'d like to use the Grails feature for creating/updating database tables on a limited basis. Specifically, I\'d like Grails to manage some tables, but not all.
Is
Thanks for the fix Steve. I'm reposting the fix above, but formatted for stackoverflow. When I first tried this I missed the fact that the original if (!command.toLowerCase()...) reversed logic in the fix as if (command.toLowerCase()...), which effectively made it look like dbCreate = "create-drop" in my config/DataSource.groovy was having no effect. I even worked from the HTML source from this page to see intended line breaks of the code, but still missed that vital bit of logic :-( Once I got this entered correctly it worked great.
private String[] prune(String[] script) {
List pruned = new ArrayList();
for (String command : script) {
boolean ignore = false;
for (String ignoreName : IGNORE_NAMES) {
if (command.toLowerCase().contains(" table " + ignoreName.toLowerCase() + " ")) {
ignore = true;
break;
}
}
if (!ignore) {
pruned.add(command);
}
}
return pruned.toArray(new String[pruned.size()]);
}