From 46ea085acf303b4576c992fbcfc86af3f551498b Mon Sep 17 00:00:00 2001 From: Laura Hausmann Date: Fri, 4 Feb 2022 06:00:17 +0100 Subject: [PATCH] Migrations: fix small error --- Migrations.cs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Migrations.cs b/Migrations.cs index 20a092d..b6622b4 100644 --- a/Migrations.cs +++ b/Migrations.cs @@ -62,8 +62,6 @@ public static class Migrations { db.InsertWithIdentity(new DbInfo { DbVer = 0 }); } - var dbinfo = db.DbInfo.First(); - Console.ForegroundColor = ConsoleColor.Yellow; Console.WriteLine($"Database version: {db.DbInfo.ToList().First().DbVer}"); @@ -74,8 +72,12 @@ public static class Migrations { } else { migrationsToRun.ForEach(RunMigration); + + var newdb = new AppDb.DbConn(); + var dbinfo = newdb.DbInfo.First(); dbinfo.DbVer = DbVer; - db.Update(dbinfo); + newdb.Update(dbinfo); + Console.ForegroundColor = ConsoleColor.DarkGreen; Console.WriteLine($"Database version is now: {DbVer}"); Console.ForegroundColor = ConsoleColor.Green;