Handle complex SQL statements with StatementBegin/End
masterIf your migration contains complex SQL statements that include semicolons (such as PL/pgSQL functions), you must wrap the block in StatementBegin and StatementEnd directives to prevent micrate from incorrectly splitting the script.
-- +micrate Up
-- +micrate StatementBegin
CREATE OR REPLACE FUNCTION example_func() RETURNS void AS $$
BEGIN
-- complex logic with semicolons
END;
$$ language plpgsql;
-- +micrate StatementEnd