Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 12a87a8762 |
@@ -42,7 +42,7 @@ func (d *Db) MigrateDb(filesystem ReadDirFileFS, directory string) error {
|
||||
log.Printf("Current version is %d, max migration version is %d", currentVersion, latestVersion)
|
||||
|
||||
// Create a backup if we're not on the latest version
|
||||
if currentVersion != latestVersion && d.source != ":memory:" {
|
||||
if currentVersion != 0 && currentVersion != latestVersion && d.source != ":memory:" {
|
||||
target := d.source + ".backup." + strconv.Itoa(currentVersion)
|
||||
log.Printf("Creating backup of database to %s", target)
|
||||
data, err := d.Db.Serialize("main")
|
||||
|
||||
Reference in New Issue
Block a user