mirror of
https://github.com/RaidMax/IW4M-Admin.git
synced 2025-06-10 15:20:48 -05:00
make database seed code less verbose
disable killserver command fix issue with default parser not saving during setup fix issue with unban reason displayed when player is rebanned
This commit is contained in:
@ -18,27 +18,11 @@ 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()
|
||||
{
|
||||
AliasLinkId = 1
|
||||
});
|
||||
|
||||
var currentAlias = new EFAlias()
|
||||
{
|
||||
AliasId = 1,
|
||||
Active = true,
|
||||
DateAdded = DateTime.UtcNow,
|
||||
Name = "IW4MAdmin",
|
||||
LinkId = 1
|
||||
};
|
||||
|
||||
context.Aliases.Add(currentAlias);
|
||||
var link = new EFAliasLink();
|
||||
|
||||
context.Clients.Add(new EFClient()
|
||||
{
|
||||
@ -50,8 +34,14 @@ namespace SharedLibraryCore.Database
|
||||
Level = Permission.Console,
|
||||
Masked = true,
|
||||
NetworkId = 0,
|
||||
AliasLinkId = 1,
|
||||
CurrentAliasId = 1,
|
||||
AliasLink = link,
|
||||
CurrentAlias = new EFAlias()
|
||||
{
|
||||
Link = link,
|
||||
Active = true,
|
||||
DateAdded = DateTime.UtcNow,
|
||||
Name = "IW4MAdmin",
|
||||
},
|
||||
});
|
||||
|
||||
await context.SaveChangesAsync();
|
||||
|
Reference in New Issue
Block a user