-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Migration error on Snowflake procedure and Clean error on Snowflake function and procedure #2577
Comments
Thanks for the detailed repro steps. The fix will be shipped in Flyway 6.1.1 |
@MikielAgutu, Thanks for fixing the snowflake bug so quickly. Issue 1: Here is the sample migration code:
Here is the error message: Issue 2: Here are the sample statements I use to check the functions and procedures in Snowflake database:
|
Which version and edition of Flyway are you using?
6.1.0 and "Flyway PR #2274"
If this is not the latest version, can you reproduce the issue with the latest one as well?
(Many bugs are fixed in newer releases and upgrading will often resolve the issue)
The issues exist in both 6.1.0 and "Flyway PR #2274"
Which client are you using? (Command-line, Java API, Maven plugin, Gradle plugin)
Command-line
Which database are you using (type & version)?
Snowflake
Which operating system are you using?
Windows
What did you do?
(Please include the content causing the issue, any relevant configuration settings, the SQL statement that failed (if relevant) and the command you ran.)
procedure migration "R__Procedure_MDM.SP_ARRAY_GET_INF_SCHEMA_TABLES.sql":
What did you expect to see?
Migrate command should apply procedure script successfully
and Clean command should drop the function and procedure successfully
What did you see instead?
Error message
Here's what I did to fix tissue
A) To fix the snowflake procedure script migration issue, I added the function extractAlternateOpenQuote(String token) in the flyway PR2274 source file flyway-core\src\main\java\org\flywaydb\core\internal\database\snowflake\SnowflakeSqlStatementBuilder.java:
@Override protected String extractAlternateOpenQuote(String token) { if (token.startsWith("$$")) { return "$$"; } return null; }
B) To fix the Clean command issue which failed in dropping the snowflake function, I modified the function generateDropFunctionStatements() in the flyway PR2274 source file snowflake\SnowflakeSchema.java. The fix is to put the quote around the function name only instead of function name and parameters.
old code:
new code:
C) To fix the Clean command issue which failed in dropping the snowflake procedure, I updated the following source code files:
added PROCEDURES("PROCEDURES", "PROCEDURE") in public enum SnowflakeObjectType { }:
The text was updated successfully, but these errors were encountered: