2017-11-25 20:29:58 -05:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Data.Entity;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
|
|
|
|
namespace SharedLibrary.Database
|
|
|
|
|
{
|
2017-11-29 19:35:50 -05:00
|
|
|
|
public class Initializer : DropCreateDatabaseIfModelChanges<DatabaseContext>
|
2017-11-25 20:29:58 -05:00
|
|
|
|
{
|
2017-11-29 19:35:50 -05:00
|
|
|
|
protected override void Seed(DatabaseContext context)
|
2017-11-25 20:29:58 -05:00
|
|
|
|
{
|
2017-11-29 19:35:50 -05:00
|
|
|
|
var aliasLink = new Models.EFAliasLink();
|
|
|
|
|
|
|
|
|
|
var currentAlias = new Models.EFAlias()
|
|
|
|
|
{
|
|
|
|
|
Active = true,
|
|
|
|
|
DateAdded = DateTime.UtcNow,
|
2018-02-10 23:33:42 -05:00
|
|
|
|
IPAddress = 0,
|
2017-11-29 19:35:50 -05:00
|
|
|
|
Name = "IW4MAdmin",
|
|
|
|
|
Link = aliasLink
|
|
|
|
|
};
|
|
|
|
|
|
2017-11-25 20:29:58 -05:00
|
|
|
|
context.Clients.Add(new Models.EFClient()
|
|
|
|
|
{
|
|
|
|
|
Active = false,
|
|
|
|
|
Connections = 0,
|
|
|
|
|
FirstConnection = DateTime.UtcNow,
|
|
|
|
|
LastConnection = DateTime.UtcNow,
|
|
|
|
|
Level = Objects.Player.Permission.Console,
|
|
|
|
|
Masked = true,
|
2018-02-10 23:33:42 -05:00
|
|
|
|
NetworkId = 0,
|
2017-11-29 19:35:50 -05:00
|
|
|
|
AliasLink = aliasLink,
|
|
|
|
|
CurrentAlias = currentAlias
|
2017-11-25 20:29:58 -05:00
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
base.Seed(context);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|