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;