-
Notifications
You must be signed in to change notification settings - Fork 522
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
Changing Delimiter w/ MySql #122
Comments
We're not using MySQL in https://github.com/pressly. Seeking help from the community on this one. |
@sjernigan looks like the SQL parser refactor might have fixed this issue. Unit test returns correct number of SQL statements. Could you pls test out v2.7.0-rc1 release candidate and report back? |
Please reopen. Still doesn't work. 2019/03/07 11:04:48 goose run: FAIL Error 1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'DELIMITER | Regardless, thanks for asking. |
Hey @sjernigan did you ever figure this out? I'm running in to the same issue and having a hard time believing we are the only two people who have attempted to create stored procs in our migrations. |
Please submit a new issue and provide a reproducer. |
Hey @VojtechVitek I was able to figure this out and there is no issue, as it turns out. I'm relatively new to MySQL (by way of many years of MSSQL) and didn't realize at first that
The only use of -- +goose Up
-- +goose StatementBegin
DROP FUNCTION IF EXISTS my_func; -- Just to be safe
-- +goose StatementEnd
-- +goose StatementBegin
CREATE FUNCTION my_func( str CHAR(255) ) RETURNS CHAR(255) DETERMINISTIC
BEGIN
RETURN "Dummy Body";
END
-- +goose StatementEnd
-- +goose Down
DROP FUNCTION IF EXISTS my_func; I tested this exact migration in my MySQL project and it worked as intended. Hope this helps. |
Awesome. Thanks for the feedback! |
I have a schema migration and requires setting some default values. I'm using a function to help set those values. The function works if entered on the CLI. However, it does not when I run it in a goose migration. As an example, the migration looks like
When run, goose replies
Seems like I tried various combinations of other delimiter characters, adding and removing the goose comments. Anything else I should try?
The text was updated successfully, but these errors were encountered: