diff --git a/migrate.go b/migrate.go index be0f498..a2701c8 100644 --- a/migrate.go +++ b/migrate.go @@ -208,18 +208,13 @@ func ParseMigration(id string, r io.ReadSeeker) (*Migration, error) { Id: id, } - up, err := sqlparse.SplitSQLStatements(r, true) + parsed, err := sqlparse.ParseMigration(r) if err != nil { return nil, err } - down, err := sqlparse.SplitSQLStatements(r, false) - if err != nil { - return nil, err - } - - m.Up = up - m.Down = down + m.Up = parsed.UpStatements + m.Down = parsed.DownStatements return m, nil }