集成测试错误H2数据库

时间:2018-08-10 17:34:52

标签: grails groovy integration-testing integration spock

我在h2数据库中运行了grails 2.5.5应用程序和集成测试,但是数据库创建表不适用于defaultValue映射为0或1的域,示例:

static mapping = {
        isManufacture(defaultValue: "b'0'")
}

正在运行grails test-app -integration向我显示此错误

| Error 2018-08-10 14:23:40,102 [main] ERROR hbm2ddl.SchemaUpdate  - Column "B" not found; SQL statement:
create table product (id bigint generated by default as identity, version bigint not null, approval_manufacturer_date timestamp, batch_validit

以真假形式映射都可以!

static mapping = {
        isManufacture(defaultValue: false)
}

我想知道,为什么h2无法识别映射,以及“ b'0'”或错误的映射域字段之间是否存在差异

我的grails应用程序的属性

版本2.5.5 MySQL数据库

1 个答案:

答案 0 :(得分:0)

isManufactured看起来是布尔类型。布尔值的默认值为true或false。我不确定“ b'0”是什么意思?

相关问题