mirror of
https://github.com/ergochat/ergo.git
synced 2025-02-16 21:50:39 +01:00
fix #2139
Database backup filenames contained a colon character, which is disallowed on Windows; use period instead
This commit is contained in:
parent
d56e4ea301
commit
3d2f014d4c
@ -150,7 +150,7 @@ func retrieveSchemaVersion(tx *buntdb.Tx) (version int, err error) {
|
|||||||
func performAutoUpgrade(currentVersion int, config *Config) (err error) {
|
func performAutoUpgrade(currentVersion int, config *Config) (err error) {
|
||||||
path := config.Datastore.Path
|
path := config.Datastore.Path
|
||||||
log.Printf("attempting to auto-upgrade schema from version %d to %d\n", currentVersion, latestDbSchema)
|
log.Printf("attempting to auto-upgrade schema from version %d to %d\n", currentVersion, latestDbSchema)
|
||||||
timestamp := time.Now().UTC().Format("2006-01-02-15:04:05.000Z")
|
timestamp := time.Now().UTC().Format("2006-01-02-15.04.05.000Z")
|
||||||
backupPath := fmt.Sprintf("%s.v%d.%s.bak", path, currentVersion, timestamp)
|
backupPath := fmt.Sprintf("%s.v%d.%s.bak", path, currentVersion, timestamp)
|
||||||
log.Printf("making a backup of current database at %s\n", backupPath)
|
log.Printf("making a backup of current database at %s\n", backupPath)
|
||||||
err = utils.CopyFile(path, backupPath)
|
err = utils.CopyFile(path, backupPath)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user