Mysql has a setting called wait_timeout, which defines the duration
after which a connection may not be used anymore. Gotify doesn't
apply this, and expects the connection to work without timeout.
The fix is to set SetConnMaxLifetime, this however, isn't the
exact counterpart for wait_timeout on mysql. wait_timeout is
relative to the last use of the connection. The go setting
uses the creation of the connection as base.
Example error output:
```
[mysql] 2020/05/31 17:53:02 packets.go:36: unexpected EOF
[GIN] 2020/05/31 - 17:53:02 | 500 | 247.062µs | 10.2.2.1 | GET "/application"
Error #01: an error occured while authenticating user
(/proj/database/client.go:24)
[2020-05-31 17:53:02] invalid connection
```
By default gorm uses the type `varbinary(255)` for []byte in database models. 255 characters isn't enough for a plugin config therefore we use longblob instead.
sqlite3 doesn't support adding a foreign key via gorm.DB#AddForeignKey
this would mean, that we have some hacky solutions for having foreign
keys for sqlite and the other databases. Therefore manually deleting
the referencing models seems to be the best solution. We already have
interfaces for database capsuling, so no api must be adjusted.
we use the database connection inside the handlers from the http
framework, therefore concurrent access occurs. Sqlite cannot handle
concurrent writes, so we limit sqlite to one connection.
see https://github.com/mattn/go-sqlite3/issues/274