-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* switch to using migrations with LcmCrdt, auto migrate all projects on startup * check for pending model changes in fw-lite workflow
- Loading branch information
Showing
9 changed files
with
1,670 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
using Microsoft.EntityFrameworkCore.Design; | ||
using Microsoft.Extensions.Configuration; | ||
using Microsoft.Extensions.DependencyInjection; | ||
|
||
namespace LcmCrdt.Data; | ||
|
||
[Obsolete("this class is only here to facilitate migrations, it's not used in the application", true)] | ||
public class DbContextDesignFactory: IDesignTimeDbContextFactory<LcmCrdtDbContext> | ||
{ | ||
public LcmCrdtDbContext CreateDbContext(string[] args) | ||
{ | ||
var servicesRoot = new ServiceCollection() | ||
.AddSingleton<IConfiguration>(new ConfigurationRoot([])) | ||
.AddLcmCrdtClient() | ||
.BuildServiceProvider(); | ||
var scope = servicesRoot.CreateScope(); | ||
scope.ServiceProvider.GetRequiredService<CurrentProjectService>().SetupProjectContextForNewDb(new ("DesignDb", "design.sqlite")); | ||
return scope.ServiceProvider.GetRequiredService<LcmCrdtDbContext>(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.