Skip to content

Commit 42da9bb

Browse files
committed
removed migrations check. only migrate now.
1 parent fac00b4 commit 42da9bb

1 file changed

Lines changed: 2 additions & 7 deletions

File tree

DisBot.API/Startup/Startup.Database.cs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,9 @@ private static async Task LoadDatabase(this WebApplication application)
1616

1717
await using var scope = application.Services.CreateAsyncScope();
1818
var dataContext = scope.ServiceProvider.GetService<DataContext>();
19-
var migrations = await dataContext.Database.GetPendingMigrationsAsync();
2019
application.Logger.Log(LogLevel.Information, "Database initialized.");
21-
if (migrations.ToArray().Length > 0)
22-
{
23-
await dataContext.Database.MigrateAsync();
24-
application.Logger.Log(LogLevel.Information, "Database migrated.");
25-
}
26-
20+
await dataContext.Database.MigrateAsync();
21+
application.Logger.Log(LogLevel.Information, "Database migrated.");
2722
application.Logger.Log(LogLevel.Information, "Database ready to accept connections.");
2823
}
2924
}

0 commit comments

Comments
 (0)