migrate welcome plugin to .NET Core 2.0

more fixes to stats database for migration
last connection set when client connects and disconnects
update GeoIP datatbase
This commit is contained in:
RaidMax
2018-04-09 14:17:10 -05:00
parent 63db309c5e
commit d233b8cb50
36 changed files with 395 additions and 481 deletions

View File

@ -17,6 +17,10 @@ namespace SharedLibraryCore.Database
public async Task Seed()
{
// make sure database exists
//context.Database.EnsureCreated();
context.Database.Migrate();
if (context.AliasLinks.Count() == 0)
{
context.AliasLinks.Add(new EFAliasLink()

View File

@ -63,6 +63,12 @@ namespace SharedLibraryCore.Database
.OnDelete(DeleteBehavior.Restrict);
});
// force full name for database conversion
modelBuilder.Entity<EFClient>().ToTable("EFClients");
modelBuilder.Entity<EFAlias>().ToTable("EFAlias");
modelBuilder.Entity<EFAliasLink>().ToTable("EFAliasLinks");
modelBuilder.Entity<EFPenalty>().ToTable("EFPenalties");
// https://aleemkhan.wordpress.com/2013/02/28/dynamically-adding-dbset-properties-in-dbcontext-for-entity-framework-code-first/
#if !DEBUG
foreach (string dllPath in Directory.GetFiles($"{Utilities.OperatingDirectory}Plugins"))