From 6c057fec6e643ce454d2c96c5c59be249e1120b5 Mon Sep 17 00:00:00 2001 From: qwerty287 Date: Sat, 20 Jul 2024 12:26:18 +0200 Subject: [PATCH] error when version missing --- models/migrations/v1_23/v302.go | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/models/migrations/v1_23/v302.go b/models/migrations/v1_23/v302.go index ee8fd85160..bb89bb42f7 100644 --- a/models/migrations/v1_23/v302.go +++ b/models/migrations/v1_23/v302.go @@ -270,14 +270,8 @@ func MigrateToXormigrate(x *xorm.Engine) error { if err != nil { return fmt.Errorf("get: %w", err) } else if !has { - // If the version record does not exist we think - // it is a fresh installation and we can skip all migrations. - currentVersion.ID = 0 - currentVersion.Version = expectedVersion - - if _, err = x.InsertOne(currentVersion); err != nil { - return fmt.Errorf("insert: %w", err) - } + // This should not happen + return fmt.Errorf("could not get version", err) } v := currentVersion.Version