Migrations: fix small error

This commit is contained in:
Laura Hausmann 2022-02-04 06:00:17 +01:00
parent 294e50409c
commit 46ea085acf
Signed by: zotan
GPG Key ID: D044E84C5BE01605
1 changed files with 5 additions and 3 deletions

View File

@ -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;