这是一个错误,看来您可以那样做,不会造成任何问题,但是,如果您不想看到此消息,则可以找到一些解决方案:(编辑:选项2似乎工作得更好(请参阅本文中的评论)
))
1.-来自DataSource.groovy的singleSession配置
https://jira.grails.org/browse/GRAILS-11198
2.-覆盖H2方言:
public class ImprovedH2Dialect extends H2Dialect { @Override public String getDropSequenceString(String sequenceName) { // Adding the "if exists" clause to avoid warnings return "drop sequence if exists " + sequenceName; } @Override public boolean dropConstraints() { // We don't need to drop constraints before dropping tables, that just // leads to error messages about missing tables when we don't have a // schema in the database return false; }}


