Stop DB access when IssueQuery class is defined
During plugin development I found out that the definition of the Query class accesses the database just by being defined.
The reason for this is the `groupable` method in the `TimestampQueryColumn` class which tries to access the current user.
This method is called during the constructor (which is called in the query column definitions in the class body of IssueQuery)
Why is this a problem?¶
In case your database is not yet created and/or migrated, any source code which just references the IssueQuery class will raise an exception since it cannot find the database/table.
And in general I think it's not good to access the database just by defining a class.
I attached a patch which also acts as a code cleanup/refactoring. It moves the group by statement into its own method. Before the boolean property `groupable` was just redefined to contain the group by statement as well, which was confusing in the first place in my opinion.
I ran all tests locally and they passed.