FIX: Store query groups in a temp table when fixing ids (PR #68)

GitHub

This has become quite a monster, I’m glad to see some tests for it. The only thing I spotted was that the sequence number on the query groups table isn’t getting updated afterwards.

Done. Thanks for reviewing @danielwaterworth! :smile: