-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Add minimum versions of databases to the docs #17080
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
We do not currently state the minimum versions of databases we support. This PR sets them to: * MySQL >=5.7 * Postgres >=10 * MSSQL >=2008R2 SP3 Signed-off-by: Andrew Thornton <[email protected]>
Now whilst checking the postgres db version is kinda easy the rest are not so, so I'm not proposing adding the additional code to check the minimum version. Although the below would do it for postgres func checkDBVersion(e *xorm.Engine) {
switch {
case setting.Database.UsePostgreSQL:
var versionString string
if _, err := e.SQL("SELECT current_setting('server_version_num')").Get(&versionString); err != nil {
log.Critical("Unable to check version of Postgres. This version of Postges may be unsupported. Error: %v", err)
return
}
version, err := strconv.Atoi(versionString)
if err != nil {
log.Critical("Unexpected DB version: %s which is not an integer. This version of Postgres may be unsupported.", versionString)
return
}
if version < 100000 {
log.Critical("This version (%s) of Postgres is unsupported. Upgrade your database.", versionString)
return
}
}
} |
xorm v1.2.3 has supports to get DB version. |
ah but MariaDB and MySQL both do interesting things with their version numbers |
We do not currently state the minimum versions of databases we support.
This PR sets them to:
Reference #17067
Signed-off-by: Andrew Thornton [email protected]