首页 > 解决方案 > 使用 flyway 命令行的雪花模式迁移问题

问题描述

我正在尝试使用 flyway 迁移雪花模式。使用以下命令:使用 url 和其他必需参数进行 flyway 迁移

我收到以下错误:

Flyway Community Edition 6.3.0 by Redgate
Database: jdbc❄️//.snowflakecomputing.com:443/ (Snowflake 4.8)
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by net.snowflake.client.jdbc.internal.io.netty.util.internal.ReflectionUtil (file:/C:/flyway-6.3.0/drivers/snowflake-jdbc-3.12.2.jar) to constructor java.nio.DirectByteBuffer(long,int)
WARNING: Please consider reporting this to the maintainers of net.snowflake.client.jdbc.internal.io.netty.util.internal.ReflectionUtil
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
ERROR:
Unable to check whether table "PUBLIC"."flyway_schema_history" exists
SQL State : 02000
Error Code : 2043
Message : SQL compilation error:
Object does not exist, or operation cannot be performed.

'warehouse' is not recognized as an internal or external command,
operable program or batch file.
'role' is not recognized as an internal or external command,
operable program or batch file.

我不知道为什么会出现此错误,因为我正确传递了所有参数

标签: flywaysnowflake-cloud-data-platform

解决方案


从错误来看,Flyway 可以连接但找不到“PUBLIC”。“flyway_schema_history”。

当一个对象像这样被双引号时,Snowflake 将其识别为区分大小写

你可能想要:

  1. 尝试通过常规 Web 登录直接连接到 Snowflake,然后查看是否select top 1 * from <database>."PUBLIC"."flyway_schema_history"正常工作。检查您是否传入了数据库参数,因为我在您的查询中看不到它。
  2. 看看您是否可以在没有双引号的情况下在 Snowflake 网站和 Flyway 中进行连接,select top 1 * from <database>.public.flyway_schema_history这样您也可以消除区分大小写的可能性。

推荐阅读