Group multiple queries per request in transaction
Add migration system
Merge branch 'master' into attachments
Add migration for attachments