File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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}
You can’t perform that action at this time.
0 commit comments