Ravii42
Ravii42

Reputation: 1

Issue with Snowflake schema migration with flyway command line

I'm trying to migrate snowflake schema with flyway. Using below command: flyway migrate with url and other required parameters

I got below error:

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.

I don't know why this error because I'm passing all the parameters correctly

Upvotes: 0

Views: 1440

Answers (1)

Allen
Allen

Reputation: 426

From the error, it looks like Flyway can connect but can't find "PUBLIC"."flyway_schema_history".

When an object is double-quoted like that Snowflake recognizes that as case-sensitive.

You might want to:

  1. Try connecting to Snowflake directly via your regular web login and then seeing if select top 1 * from <database>."PUBLIC"."flyway_schema_history" works correctly. Check to see that you are passing in a database parameter since I can't see that in your query.
  2. See if you can connect in both the Snowflake website without the double quotes and in Flyway so that select top 1 * from <database>.public.flyway_schema_history also works so you remove case-sensitivity as a possibility.

Upvotes: 1

Related Questions