我正在 ColdBox 应用程序(在 Lucee 上)中测试 h2 数据库...我可以使用 Quick 连接到数据库,但我无法运行迁移...
这是迁移 init 和迁移后在 CommandBox 中显示的错误
ERROR (5.2.1+00295)
Schema "information_schema" not found; SQL statement:SELECT 1 FROM "information_schema"."tables" WHERE "table_name" = ? AND "table_schema" = ? [90079-172]
MigrationService.cfc
SELECT 1 FROM "information_schema"."tables" WHERE "table_name" = 'cfmigrations' AND "table_schema" = 'testAppDB'
Application.cfc 和 box.json 都使用 ENVIRONMENT 设置:
# ColdBox Name and Environment
APPNAME=tastApp
ENVIRONMENT=development
DB_BUNDLEVERSION=1.3.172
DB_PORT=
DB_USER=sa
DB_BUNDLENAME=org.h2
DB_CLASS=org.h2.Driver
DB_HOST=127.0.0.1
DB_DRIVER=org.h2.Driver
DB_SCHEMA=appDB
DB_DATABASE=appDB
DB_CONNECTIONSTRING=jdbc:h2:/Users/elena/coldbox-examples/testApp/database/appDB;MODE=MySQL;
DB_PASSWORD=
h2 是从 Lucee 下载页面下载并保存在 /lib 文件夹中(我在 box.json 中添加了依赖项)
这是语法设置:
"defaultGrammar":"自动发现@qb"
我错过了什么?
先感谢您
埃琳娜
更新 - 5月18日
感谢 Evgenij,
现在我可以查询最新版本的 h2 1.4.200,它接受设置 (CASE_INSENSITIVE_IDENTIFIERS = TRUE),这使得所有标识符名称(表名、列名)不区分大小写。
不幸的是,使用 commandbox-migrations 的迁移仍然给我错误:
这些是我正在使用的当前配置:
"cfmigrations":{
"migrationsDirectory":"resources/database/migrations",
"schema":"INFORMATION_SCHEMA",
"connectionInfo":{
"bundleName":"com.h2database",
"bundleVersion":"1.4.200",
"password":"",
"connectionString":"jdbc:h2:/Users/elena/coldbox-examples/testApp/database/appDB;MODE=MySQL;DATABASE_TO_LOWER=TRUE;CASE_INSENSITIVE_IDENTIFIERS=TRUE;",
"class":"org.h2.Driver",
"username":""
},
"defaultGrammar":"AutoDiscover@qb"
}
这是最后一个错误:
> * > CLI v5.2.1 > 10:59 AM > ~/coldbox-examples/testApp/ > testApp (1.0.0) >
lucee 5.3.7 (running) >
> migrate up
ERROR (5.2.1+00295) Unable to resolve com.h2database [108](R 108.0): missing requirement [com.h2database [108](R 108.0)] osgi.wiring.package; (&(osgi.wiring.package=org.osgi.framework)(version>=1.5.0))
Unresolved requirements: [[com.h2database [108](R 108.0)] osgi.wiring.package; (&(osgi.wiring.package=org.osgi.framework)(version>=1.5.0))]
caused by: org.osgi.framework.BundleException
Unable to resolve com.h2database [108](R 108.0): missing requirement [com.h2database [108](R 108.0)] osgi.wiring.package; (&(osgi.wiring.package=org.osgi.framework)(version>=1.5.0)) Unresolved requirements: [[com.h2database [108](R 108.0)] osgi.wiring.package; (&(osgi.wiring.package=org.osgi.framework)(version>=1.5.0))]