Skip to content

Commit

Permalink
fix: handle ported mysql version string from some distros
Browse files Browse the repository at this point in the history
  • Loading branch information
csmig committed Oct 3, 2024
1 parent 6e186d1 commit 0ea0f16
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion api/source/service/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ const Umzug = require('umzug')
const path = require('path')
const fs = require("fs")
const semverLt = require('semver/functions/lt')
const semverCoerce = require('semver/functions/coerce')
const Importer = require('./migrations/lib/mysql-import.js')
const minMySqlVersion = '8.0.21'
let _this = this
Expand Down Expand Up @@ -111,7 +112,7 @@ module.exports.initializeDatabase = async function (depStatus) {
logger.writeError('mysql', 'preflight', { success: false, message: error.message })
}
})
if (semverLt(detectedMySqlVersion, minMySqlVersion) ) {
if (semverLt(semverCoerce(detectedMySqlVersion), minMySqlVersion) ) {
logger.writeError('mysql', 'preflight', { success: false, message: `MySQL release ${detectedMySqlVersion} is too old. Update to release ${minMySqlVersion} or later.` })
process.exit(1)
}
Expand Down

0 comments on commit 0ea0f16

Please sign in to comment.