mirror of
https://github.com/ClusterCockpit/cc-backend
synced 2025-07-23 12:51:40 +02:00
Set all versions and print in version flag
This commit is contained in:
@@ -30,7 +30,7 @@ import (
|
||||
)
|
||||
|
||||
// @title ClusterCockpit REST API
|
||||
// @version 0.2.0
|
||||
// @version 1
|
||||
// @description API for batch job control.
|
||||
|
||||
// @tag.name Job API
|
||||
|
@@ -17,7 +17,7 @@ import (
|
||||
"github.com/golang-migrate/migrate/v4/source/iofs"
|
||||
)
|
||||
|
||||
const supportedVersion uint = 3
|
||||
const Version uint = 3
|
||||
|
||||
//go:embed migrations/*
|
||||
var migrationFiles embed.FS
|
||||
@@ -65,13 +65,13 @@ func checkDBVersion(backend string, db *sql.DB) {
|
||||
}
|
||||
}
|
||||
|
||||
if v < supportedVersion {
|
||||
log.Warnf("Unsupported database version %d, need %d.\nPlease backup your database file and run cc-backend --migrate-db", v, supportedVersion)
|
||||
if v < Version {
|
||||
log.Warnf("Unsupported database version %d, need %d.\nPlease backup your database file and run cc-backend --migrate-db", v, Version)
|
||||
os.Exit(0)
|
||||
}
|
||||
|
||||
if v > supportedVersion {
|
||||
log.Warnf("Unsupported database version %d, need %d.\nPlease refer to documentation how to downgrade db with external migrate tool!", v, supportedVersion)
|
||||
if v > Version {
|
||||
log.Warnf("Unsupported database version %d, need %d.\nPlease refer to documentation how to downgrade db with external migrate tool!", v, Version)
|
||||
os.Exit(0)
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user