我正在ColdBox应用程序中测试h2数据库(在Lucee上) ...我可以使用Quick连接到数据库,但无法运行迁移...
这是在初始化迁移和向上迁移后在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都使用环境设置:
# 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日
多亏了叶夫根尼
现在,我可以查询最新版本的h2 1.4.200,它接受设置(CASE_INSENSITIVE_IDENTIFIERS = TRUE),该设置使所有标识符名(表名、列名)不区分大小写。
不幸的是,使用commandbox give 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))]发布于 2021-05-06 20:45:31
H2 1.3.172非常旧,它不能正确地模拟来自MySQL的非标准小写INFORMATION_SCHEMA。
您需要使用最新版本的H2 (例如,1.4.200 )并将;MODE=MySQL;DATABASE_TO_LOWER=TRUE附加到JDBC URL,仅使用;MODE=MySQL是不够的。
https://stackoverflow.com/questions/67414843
复制相似问题