Grails 表「;XXX“;在圣杯中找不到

Grails 表「;XXX“;在圣杯中找不到,grails,orm,mapping,h2,Grails,Orm,Mapping,H2,尝试导入旧的grails项目时,映射似乎有问题。一切都很完美,直到 Server running. Browse to http://localhost:8080/prmptvServer Configuring Spring Security Core ... ... finished configuring Spring Security Core | Error 2015-11-30 09:06:43,636 [localhost-startStop-1] ERROR hbm2ddl.S

尝试导入旧的grails项目时,映射似乎有问题。一切都很完美,直到

Server running. Browse to http://localhost:8080/prmptvServer
Configuring Spring Security Core ...
... finished configuring Spring Security Core

| Error 2015-11-30 09:06:43,636 [localhost-startStop-1] ERROR hbm2ddl.SchemaExport  - HHH000389: Unsuccessful: alter table bank_account drop constraint FK_ss4uej5gx2a07srb540l15s21 if exists 
| Error 2015-11-30 09:06:43,638 [localhost-startStop-1] ERROR hbm2ddl.SchemaExport  - Table "BANK_ACCOUNT" not found; SQL statement: alter table bank_account drop constraint FK_ss4uej5gx2a07srb540l15s21 if exists [42102-176]
其余的域也无法加载。据我所知,如果我的数据源包含

dbCreate=“创建拖放”

,每次重新启动应用程序时都应该重建数据库,不是吗?至少我记得是这样。如果它找不到表,它不是被创建了吗?如果它不是在应该创建的时候创建的,我是否应该得到另一个错误,比如“无法创建表”

Bootstrap.groovy都被注释为更容易进行调试

DataSource.groovy

dataSource {
    pooled = true
    jmxExport = true
    driverClassName = "org.h2.Driver"
    username = "sa"
    password = ""
}

hibernate {
    cache.use_second_level_cache = true
    cache.use_query_cache = false
//    cache.region.factory_class = 'net.sf.ehcache.hibernate.EhCacheRegionFactory' // Hibernate 3
    cache.region.factory_class = 'org.hibernate.cache.ehcache.EhCacheRegionFactory' // Hibernate 4
    singleSession = true // configure OSIV singleSession mode
    flush.mode = 'manual' // OSIV session flush mode outside of transactional context
}

// environment specific settings
environments {
    development {
        dataSource {
            dbCreate = "create-drop" // one of 'create', 'create-drop', 'update', 'validate', ''
            url = "jdbc:h2:mem:devDb;MVCC=TRUE;LOCK_TIMEOUT=10000;DB_CLOSE_ON_EXIT=FALSE"
        }
    }...
BankAccount.groovy

class BankAccount {

    SecUser user
    String alias
    String number

    static constraints = {
        alias nullable: false, blank: false
        number nullable: false, blank: false
    }
}

我认为这不是一个关键问题。我在我的项目中也遇到同样的错误,但应用程序仍然运行良好

我认为这种配置存在一些不一致性。不是关于你,而是关于圣杯

也许这篇文章可以回答你的问题->