Hi guys,
I do not know if there is a simple way around it, but I am running into a bug when using MySQL and Flyway. Version doesn't really matter, but I tried it with MySQL5-8 as well as Flyway 6.2.1.
CREATE TRIGGER before_insert_users BEFORE INSERT ON USERS FOR EACH ROW IF new.api_key IS NULL THEN SET new.api_key = uuid(); END IF;
The issue is that Flyway parses in the statement but thinks the ";" after uuid() is the end of the statement, hence cutting of the END IF and hence you cannot apply that migration succesfully.
Is there an easy way to change delimiters in these cases or is this a bug?
Thanks
Marco
The text was updated successfully, but these errors were encountered:
After more investigation we've actually found a workaround using the MySql DELIMITER option. The parser seems to be happy with things like:
DELIMITER #
CREATE TRIGGER before_insert_users BEFORE INSERT ON USERS FOR EACH ROW IF new.api_key IS NULL THEN SET new.api_key = uuid(); END IF#
DELIMITER ;
Hi guys,
I do not know if there is a simple way around it, but I am running into a bug when using MySQL and Flyway. Version doesn't really matter, but I tried it with MySQL5-8 as well as Flyway 6.2.1.
CREATE TRIGGER before_insert_users BEFORE INSERT ON USERS FOR EACH ROW IF new.api_key IS NULL THEN SET new.api_key = uuid(); END IF;
The issue is that Flyway parses in the statement but thinks the ";" after uuid() is the end of the statement, hence cutting of the END IF and hence you cannot apply that migration succesfully.
Is there an easy way to change delimiters in these cases or is this a bug?
Thanks
Marco
The text was updated successfully, but these errors were encountered: