Do not create backups for new databases
All checks were successful
Build / build (push) Successful in 1m27s
All checks were successful
Build / build (push) Successful in 1m27s
This commit is contained in:
parent
87f10c73d6
commit
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)
|
log.Printf("Current version is %d, max migration version is %d", currentVersion, latestVersion)
|
||||||
|
|
||||||
// Create a backup if we're not on the latest version
|
// 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)
|
target := d.source + ".backup." + strconv.Itoa(currentVersion)
|
||||||
log.Printf("Creating backup of database to %s", target)
|
log.Printf("Creating backup of database to %s", target)
|
||||||
data, err := d.Db.Serialize("main")
|
data, err := d.Db.Serialize("main")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user