Which version and edition of Flyway are you using?
Flyway Community Edition 6.4.0 by Redgate installed via Brew
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)
Yes, I upgraded my CLI just before submitting this issue.
Which client are you using? (Command-line, Java API, Maven plugin, Gradle plugin)
CLI via brew
I also use the Maven plugin, but have not tested this change there yet.
Which database are you using (type & version)?
MariaDB 10.3.22 with InnoDB schema
Which operating system are you using?
macOS Catalina 10.15.4
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.)
ALTER TABLE mydb.quantities ADD COLUMN IF NOT EXISTS quantity_name VARCHAR(150) DEFAULT NULL;
What did you expect to see?
The migration to succeed with a new column created in the schema if the column did not previously exist in the schema.
What did you see instead?
ERROR: Unable to parse statement in /V7__Refactor.sql at line 9 col 1: Incomplete statement at line 9 col 1: ALTER TABLE mydb.quantities ADD COLUMN IF NOT EXISTS quantity_name VARCHAR(150) DEFAULT NULL;
Removing the "IF NOT EXISTS" text from the SQL works allows the migration to work. Running the SQL directly in MariaDB 10.3.22 also works.
The text was updated successfully, but these errors were encountered:
ngintherBW commentedApr 29, 2020
Which version and edition of Flyway are you using?
Flyway Community Edition 6.4.0 by Redgate installed via Brew
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)
Yes, I upgraded my CLI just before submitting this issue.
Which client are you using? (Command-line, Java API, Maven plugin, Gradle plugin)
CLI via brew
I also use the Maven plugin, but have not tested this change there yet.
Which database are you using (type & version)?
MariaDB 10.3.22 with InnoDB schema
Which operating system are you using?
macOS Catalina 10.15.4
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.)
ALTER TABLE
mydb
.quantities
ADD COLUMN IF NOT EXISTSquantity_name
VARCHAR(150) DEFAULT NULL;What did you expect to see?
The migration to succeed with a new column created in the schema if the column did not previously exist in the schema.
What did you see instead?
ERROR: Unable to parse statement in /V7__Refactor.sql at line 9 col 1: Incomplete statement at line 9 col 1: ALTER TABLE
mydb
.quantities
ADD COLUMN IF NOT EXISTSquantity_name
VARCHAR(150) DEFAULT NULL;Removing the "IF NOT EXISTS" text from the SQL works allows the migration to work. Running the SQL directly in MariaDB 10.3.22 also works.
The text was updated successfully, but these errors were encountered: