Issue 386 Converted some patches to raw SQL and grouped them per change