update for database provider specific migrations
fix issues with live radar
This commit is contained in:
parent
8ef2959f63
commit
36a02b3d7b
3
.gitignore
vendored
3
.gitignore
vendored
@ -244,4 +244,5 @@ launchSettings.json
|
||||
/Tests/ApplicationTests/Files/GameEvents.json
|
||||
/Tests/ApplicationTests/Files/replay.json
|
||||
/GameLogServer/game_log_server_env
|
||||
.idea/*
|
||||
.idea/*
|
||||
*.db
|
@ -53,7 +53,6 @@ namespace IW4MAdmin.Application
|
||||
private readonly ILogger _logger;
|
||||
private readonly List<MessageToken> MessageTokens;
|
||||
private readonly ClientService ClientSvc;
|
||||
readonly AliasService AliasSvc;
|
||||
readonly PenaltyService PenaltySvc;
|
||||
public IConfigurationHandler<ApplicationConfiguration> ConfigHandler;
|
||||
readonly IPageList PageList;
|
||||
@ -80,14 +79,13 @@ namespace IW4MAdmin.Application
|
||||
IEnumerable<IPlugin> plugins, IParserRegexFactory parserRegexFactory, IEnumerable<IRegisterEvent> customParserEvents,
|
||||
IEventHandler eventHandler, IScriptCommandFactory scriptCommandFactory, IDatabaseContextFactory contextFactory, IMetaService metaService,
|
||||
IMetaRegistration metaRegistration, IScriptPluginServiceResolver scriptPluginServiceResolver, ClientService clientService, IServiceProvider serviceProvider,
|
||||
ChangeHistoryService changeHistoryService, ApplicationConfiguration appConfig)
|
||||
ChangeHistoryService changeHistoryService, ApplicationConfiguration appConfig, PenaltyService penaltyService)
|
||||
{
|
||||
MiddlewareActionHandler = actionHandler;
|
||||
_servers = new ConcurrentBag<Server>();
|
||||
MessageTokens = new List<MessageToken>();
|
||||
ClientSvc = clientService;
|
||||
AliasSvc = new AliasService();
|
||||
PenaltySvc = new PenaltyService();
|
||||
PenaltySvc = penaltyService;
|
||||
ConfigHandler = appConfigHandler;
|
||||
StartTime = DateTime.UtcNow;
|
||||
PageList = new PageList();
|
||||
@ -401,16 +399,16 @@ namespace IW4MAdmin.Application
|
||||
#endregion
|
||||
|
||||
#region DATABASE
|
||||
using (var db = new DatabaseContext(GetApplicationSettings().Configuration()?.ConnectionString,
|
||||
GetApplicationSettings().Configuration()?.DatabaseProvider))
|
||||
{
|
||||
await new ContextSeed(db).Seed();
|
||||
DatabaseHousekeeping.RemoveOldRatings(db);
|
||||
}
|
||||
_logger.LogInformation("Beginning database migration sync");
|
||||
Console.WriteLine(_translationLookup["MANAGER_MIGRATION_START"]);
|
||||
await ContextSeed.Seed(_serviceProvider.GetRequiredService<IDatabaseContextFactory>(), _tokenSource.Token);
|
||||
await DatabaseHousekeeping.RemoveOldRatings(_serviceProvider.GetRequiredService<IDatabaseContextFactory>(), _tokenSource.Token);
|
||||
_logger.LogInformation("Finished database migration sync");
|
||||
Console.WriteLine(_translationLookup["MANAGER_MIGRATION_END"]);
|
||||
#endregion
|
||||
|
||||
#region COMMANDS
|
||||
if (ClientSvc.GetOwners().Result.Count > 0)
|
||||
if (await ClientSvc.HasOwnerAsync(_tokenSource.Token))
|
||||
{
|
||||
_commands.RemoveAll(_cmd => _cmd.GetType() == typeof(OwnerCommand));
|
||||
}
|
||||
@ -565,11 +563,6 @@ namespace IW4MAdmin.Application
|
||||
return ClientSvc;
|
||||
}
|
||||
|
||||
public AliasService GetAliasService()
|
||||
{
|
||||
return AliasSvc;
|
||||
}
|
||||
|
||||
public PenaltyService GetPenaltyService()
|
||||
{
|
||||
return PenaltySvc;
|
||||
|
@ -1,9 +1,16 @@
|
||||
using System.IO;
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Runtime.InteropServices;
|
||||
using Microsoft.Data.Sqlite;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Serilog;
|
||||
using Serilog.Events;
|
||||
using SharedLibraryCore;
|
||||
using SharedLibraryCore.Configuration;
|
||||
using SharedLibraryCore.Database;
|
||||
using SharedLibraryCore.Database.MigrationContext;
|
||||
|
||||
namespace IW4MAdmin.Application.Extensions
|
||||
{
|
||||
@ -21,13 +28,16 @@ namespace IW4MAdmin.Application.Extensions
|
||||
.Build();
|
||||
|
||||
var loggerConfig = new LoggerConfiguration()
|
||||
.ReadFrom.Configuration(configuration);
|
||||
.ReadFrom.Configuration(configuration)
|
||||
.MinimumLevel.Override("Microsoft", LogEventLevel.Warning);
|
||||
|
||||
|
||||
if (Utilities.IsDevelopment)
|
||||
{
|
||||
loggerConfig = loggerConfig.WriteTo.Console(
|
||||
outputTemplate:"[{Timestamp:yyyy-MM-dd HH:mm:ss.fff} {Server} {Level:u3}] {Message:lj}{NewLine}{Exception}")
|
||||
outputTemplate:
|
||||
"[{Timestamp:yyyy-MM-dd HH:mm:ss.fff} {Server} {Level:u3}] {Message:lj}{NewLine}{Exception}")
|
||||
.MinimumLevel.Override("Microsoft", LogEventLevel.Warning)
|
||||
.MinimumLevel.Debug();
|
||||
}
|
||||
|
||||
@ -37,5 +47,46 @@ namespace IW4MAdmin.Application.Extensions
|
||||
services.AddLogging(builder => builder.AddSerilog(_defaultLogger, dispose: true));
|
||||
return services;
|
||||
}
|
||||
|
||||
public static IServiceCollection AddDatabaseContext(this IServiceCollection services,
|
||||
ApplicationConfiguration appConfig)
|
||||
{
|
||||
if (string.IsNullOrEmpty(appConfig.ConnectionString) || appConfig.DatabaseProvider == "sqlite")
|
||||
{
|
||||
var currentPath = Utilities.OperatingDirectory;
|
||||
currentPath = !RuntimeInformation.IsOSPlatform(OSPlatform.Windows)
|
||||
? $"{Path.DirectorySeparatorChar}{currentPath}"
|
||||
: currentPath;
|
||||
|
||||
var connectionStringBuilder = new SqliteConnectionStringBuilder
|
||||
{DataSource = Path.Join(currentPath, "Database", "Database.db")};
|
||||
var connectionString = connectionStringBuilder.ToString();
|
||||
|
||||
services.AddDbContext<DatabaseContext, SqliteDatabaseContext>(options =>
|
||||
options.UseSqlite(connectionString), ServiceLifetime.Transient);
|
||||
return services;
|
||||
}
|
||||
|
||||
switch (appConfig.DatabaseProvider)
|
||||
{
|
||||
case "mysql":
|
||||
var appendTimeout = !appConfig.ConnectionString.Contains("default command timeout",
|
||||
StringComparison.InvariantCultureIgnoreCase);
|
||||
services.AddDbContext<DatabaseContext, MySqlDatabaseContext>(options =>
|
||||
options.UseMySql(
|
||||
appConfig.ConnectionString + (appendTimeout ? "default command timeout=0" : ""),
|
||||
mysqlOptions => mysqlOptions.EnableRetryOnFailure()), ServiceLifetime.Transient);
|
||||
break;
|
||||
case "postgresql":
|
||||
appendTimeout = !appConfig.ConnectionString.Contains("Command Timeout",
|
||||
StringComparison.InvariantCultureIgnoreCase);
|
||||
services.AddDbContext<DatabaseContext, PostgresqlDatabaseContext>(options =>
|
||||
options.UseNpgsql(appConfig.ConnectionString + (appendTimeout ? "Command Timeout=0" : ""),
|
||||
postgresqlOptions => postgresqlOptions.EnableRetryOnFailure()), ServiceLifetime.Transient);
|
||||
break;
|
||||
}
|
||||
|
||||
return services;
|
||||
}
|
||||
}
|
||||
}
|
@ -1,4 +1,7 @@
|
||||
using SharedLibraryCore.Database;
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using SharedLibraryCore.Database;
|
||||
using SharedLibraryCore.Interfaces;
|
||||
|
||||
namespace IW4MAdmin.Application.Factories
|
||||
@ -8,6 +11,13 @@ namespace IW4MAdmin.Application.Factories
|
||||
/// </summary>
|
||||
public class DatabaseContextFactory : IDatabaseContextFactory
|
||||
{
|
||||
private readonly IServiceProvider _serviceProvider;
|
||||
|
||||
public DatabaseContextFactory(IServiceProvider serviceProvider)
|
||||
{
|
||||
_serviceProvider = serviceProvider;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// creates a new database context
|
||||
/// </summary>
|
||||
@ -15,7 +25,24 @@ namespace IW4MAdmin.Application.Factories
|
||||
/// <returns></returns>
|
||||
public DatabaseContext CreateContext(bool? enableTracking = true)
|
||||
{
|
||||
return enableTracking.HasValue ? new DatabaseContext(disableTracking: !enableTracking.Value) : new DatabaseContext();
|
||||
var context = _serviceProvider.GetRequiredService<DatabaseContext>();
|
||||
|
||||
enableTracking ??= true;
|
||||
|
||||
if (enableTracking.Value)
|
||||
{
|
||||
context.ChangeTracker.AutoDetectChangesEnabled = true;
|
||||
context.ChangeTracker.LazyLoadingEnabled = true;
|
||||
context.ChangeTracker.QueryTrackingBehavior = QueryTrackingBehavior.TrackAll;
|
||||
}
|
||||
else
|
||||
{
|
||||
context.ChangeTracker.AutoDetectChangesEnabled = false;
|
||||
context.ChangeTracker.LazyLoadingEnabled = false;
|
||||
context.ChangeTracker.QueryTrackingBehavior = QueryTrackingBehavior.NoTracking;
|
||||
}
|
||||
|
||||
return context;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -334,7 +334,7 @@ namespace IW4MAdmin
|
||||
// possible a connect/reconnect game event before we get to process it here
|
||||
// it appears that new games decide to switch client slots between maps (even if the clients aren't disconnecting)
|
||||
// bots can have duplicate names which causes conflicting GUIDs
|
||||
else if (existingClient != null && existingClient.ClientNumber != E.Origin.ClientNumber &&
|
||||
if (existingClient != null && existingClient.ClientNumber != E.Origin.ClientNumber &&
|
||||
!E.Origin.IsBot)
|
||||
{
|
||||
ServerLogger.LogWarning(
|
||||
|
@ -81,6 +81,7 @@ namespace IW4MAdmin.Application
|
||||
ITranslationLookup translationLookup = null;
|
||||
var logger = BuildDefaultLogger<Program>(new ApplicationConfiguration());
|
||||
Utilities.DefaultLogger = logger;
|
||||
IServiceCollection services = null;
|
||||
logger.LogInformation("Begin IW4MAdmin startup. Version is {version} {@args}", Version, args);
|
||||
|
||||
try
|
||||
@ -89,7 +90,7 @@ namespace IW4MAdmin.Application
|
||||
ConfigurationMigration.MoveConfigFolder10518(null);
|
||||
ConfigurationMigration.CheckDirectories();
|
||||
logger.LogDebug("Configuring services...");
|
||||
var services = ConfigureServices(args);
|
||||
services = ConfigureServices(args);
|
||||
serviceProvider = services.BuildServiceProvider();
|
||||
var versionChecker = serviceProvider.GetRequiredService<IMasterCommunication>();
|
||||
ServerManager = (ApplicationManager)serviceProvider.GetRequiredService<IManager>();
|
||||
@ -137,7 +138,7 @@ namespace IW4MAdmin.Application
|
||||
|
||||
try
|
||||
{
|
||||
ApplicationTask = RunApplicationTasksAsync(logger);
|
||||
ApplicationTask = RunApplicationTasksAsync(logger, services);
|
||||
await ApplicationTask;
|
||||
}
|
||||
|
||||
@ -160,10 +161,10 @@ namespace IW4MAdmin.Application
|
||||
/// runs the core application tasks
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
private static async Task RunApplicationTasksAsync(ILogger logger)
|
||||
private static async Task RunApplicationTasksAsync(ILogger logger, IServiceCollection services)
|
||||
{
|
||||
var webfrontTask = ServerManager.GetApplicationSettings().Configuration().EnableWebFront ?
|
||||
WebfrontCore.Program.Init(ServerManager, serviceProvider, ServerManager.CancellationToken) :
|
||||
WebfrontCore.Program.Init(ServerManager, serviceProvider, services, ServerManager.CancellationToken) :
|
||||
Task.CompletedTask;
|
||||
|
||||
// we want to run this one on a manual thread instead of letting the thread pool handle it,
|
||||
@ -322,9 +323,13 @@ namespace IW4MAdmin.Application
|
||||
.AddBaseLogger(appConfig)
|
||||
.AddSingleton<IServiceCollection>(_serviceProvider => serviceCollection)
|
||||
.AddSingleton((IConfigurationHandler<ApplicationConfiguration>) appConfigHandler)
|
||||
.AddSingleton(new BaseConfigurationHandler<CommandConfiguration>("CommandConfiguration") as IConfigurationHandler<CommandConfiguration>)
|
||||
.AddSingleton(
|
||||
new BaseConfigurationHandler<CommandConfiguration>("CommandConfiguration") as
|
||||
IConfigurationHandler<CommandConfiguration>)
|
||||
.AddSingleton(appConfig)
|
||||
.AddSingleton(_serviceProvider => _serviceProvider.GetRequiredService<IConfigurationHandler<CommandConfiguration>>().Configuration() ?? new CommandConfiguration())
|
||||
.AddSingleton(_serviceProvider =>
|
||||
_serviceProvider.GetRequiredService<IConfigurationHandler<CommandConfiguration>>()
|
||||
.Configuration() ?? new CommandConfiguration())
|
||||
.AddSingleton<IPluginImporter, PluginImporter>()
|
||||
.AddSingleton<IMiddlewareActionHandler, MiddlewareActionHandler>()
|
||||
.AddSingleton<IRConConnectionFactory, RConConnectionFactory>()
|
||||
@ -338,12 +343,16 @@ namespace IW4MAdmin.Application
|
||||
.AddSingleton<IEntityService<EFClient>, ClientService>()
|
||||
.AddSingleton<IMetaService, MetaService>()
|
||||
.AddSingleton<ClientService>()
|
||||
.AddSingleton<PenaltyService>()
|
||||
.AddSingleton<ChangeHistoryService>()
|
||||
.AddSingleton<IMetaRegistration, MetaRegistration>()
|
||||
.AddSingleton<IScriptPluginServiceResolver, ScriptPluginServiceResolver>()
|
||||
.AddSingleton<IResourceQueryHelper<ClientPaginationRequest, ReceivedPenaltyResponse>, ReceivedPenaltyResourceQueryHelper>()
|
||||
.AddSingleton<IResourceQueryHelper<ClientPaginationRequest, AdministeredPenaltyResponse>, AdministeredPenaltyResourceQueryHelper>()
|
||||
.AddSingleton<IResourceQueryHelper<ClientPaginationRequest, UpdatedAliasResponse>, UpdatedAliasResourceQueryHelper>()
|
||||
.AddSingleton<IResourceQueryHelper<ClientPaginationRequest, ReceivedPenaltyResponse>,
|
||||
ReceivedPenaltyResourceQueryHelper>()
|
||||
.AddSingleton<IResourceQueryHelper<ClientPaginationRequest, AdministeredPenaltyResponse>,
|
||||
AdministeredPenaltyResourceQueryHelper>()
|
||||
.AddSingleton<IResourceQueryHelper<ClientPaginationRequest, UpdatedAliasResponse>,
|
||||
UpdatedAliasResourceQueryHelper>()
|
||||
.AddSingleton<IResourceQueryHelper<ChatSearchQuery, MessageResponse>, ChatResourceQueryHelper>()
|
||||
.AddTransient<IParserPatternMatcher, ParserPatternMatcher>()
|
||||
.AddSingleton<IRemoteAssemblyHandler, RemoteAssemblyHandler>()
|
||||
@ -351,7 +360,8 @@ namespace IW4MAdmin.Application
|
||||
.AddSingleton<IManager, ApplicationManager>()
|
||||
.AddSingleton<SharedLibraryCore.Interfaces.ILogger, Logger>()
|
||||
.AddSingleton<IClientNoticeMessageFormatter, ClientNoticeMessageFormatter>()
|
||||
.AddSingleton(translationLookup);
|
||||
.AddSingleton(translationLookup)
|
||||
.AddDatabaseContext(appConfig);
|
||||
|
||||
if (args.Contains("serialevents"))
|
||||
{
|
||||
|
@ -1,20 +1,24 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using IW4MAdmin.Plugins.Stats.Models;
|
||||
using SharedLibraryCore.Database;
|
||||
using SharedLibraryCore.Interfaces;
|
||||
|
||||
namespace IW4MAdmin.Application.Migration
|
||||
{
|
||||
public static class DatabaseHousekeeping
|
||||
{
|
||||
private static DateTime _cutoffDate = DateTime.UtcNow.AddMonths(-6);
|
||||
private static readonly DateTime CutoffDate = DateTime.UtcNow.AddMonths(-6);
|
||||
|
||||
public static void RemoveOldRatings(DatabaseContext context)
|
||||
public static async Task RemoveOldRatings(IDatabaseContextFactory contextFactory, CancellationToken token)
|
||||
{
|
||||
await using var context = contextFactory.CreateContext();
|
||||
var dbSet = context.Set<EFRating>();
|
||||
var itemsToDelete = dbSet.Where(rating => rating.When <= _cutoffDate);
|
||||
var itemsToDelete = dbSet.Where(rating => rating.When <= CutoffDate);
|
||||
dbSet.RemoveRange(itemsToDelete);
|
||||
context.SaveChanges();
|
||||
await context.SaveChangesAsync(token);
|
||||
}
|
||||
}
|
||||
}
|
@ -118,7 +118,28 @@ namespace IW4MAdmin.Application.Misc
|
||||
})
|
||||
.CatchClrExceptions());
|
||||
|
||||
_scriptEngine.Execute(script);
|
||||
try
|
||||
{
|
||||
_scriptEngine.Execute(script);
|
||||
}
|
||||
catch (JavaScriptException ex)
|
||||
{
|
||||
|
||||
_logger.LogError(ex,
|
||||
"Encountered JavaScript runtime error while executing {methodName} for script plugin {plugin} at {@locationInfo}",
|
||||
nameof(Initialize), _fileName, ex.Location);
|
||||
throw new PluginException($"A JavaScript parsing error occured while initializing script plugin");
|
||||
}
|
||||
|
||||
catch (Exception e)
|
||||
{
|
||||
|
||||
_logger.LogError(e,
|
||||
"Encountered unexpected error while running {methodName} for script plugin {plugin}",
|
||||
nameof(Initialize), _fileName);
|
||||
throw new PluginException($"An unexpected error occured while initialization script plugin");
|
||||
}
|
||||
|
||||
_scriptEngine.SetValue("_localization", Utilities.CurrentLocalization);
|
||||
_scriptEngine.SetValue("_serviceResolver", serviceResolver);
|
||||
dynamic pluginObject = _scriptEngine.GetValue("plugin").ToObject();
|
||||
|
@ -2,6 +2,7 @@
|
||||
using SharedLibraryCore;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.Extensions.Logging;
|
||||
@ -68,7 +69,9 @@ namespace LiveRadar
|
||||
|
||||
lock (lockObject)
|
||||
{
|
||||
generatedBotGuid = _botGuidLookups.ContainsKey(botKey) ? _botGuidLookups[botKey] : 0;
|
||||
generatedBotGuid = _botGuidLookups.ContainsKey(botKey)
|
||||
? _botGuidLookups[botKey]
|
||||
: (E.Extra.ToString() ?? "0").ConvertGuidToLong(NumberStyles.HexNumber);
|
||||
}
|
||||
|
||||
var radarUpdate = RadarEvent.Parse(E.Data, generatedBotGuid);
|
||||
|
@ -16,7 +16,7 @@ namespace IW4MAdmin.Plugins.Stats.Commands
|
||||
{
|
||||
class MostPlayedCommand : Command
|
||||
{
|
||||
public static async Task<List<string>> GetMostPlayed(Server s, ITranslationLookup translationLookup)
|
||||
public static async Task<List<string>> GetMostPlayed(Server s, ITranslationLookup translationLookup, IDatabaseContextFactory contextFactory)
|
||||
{
|
||||
long serverId = StatManager.GetIdForServer(s);
|
||||
|
||||
@ -25,42 +25,39 @@ namespace IW4MAdmin.Plugins.Stats.Commands
|
||||
$"^5--{translationLookup["PLUGINS_STATS_COMMANDS_MOSTPLAYED_TEXT"]}--"
|
||||
};
|
||||
|
||||
using (var db = new DatabaseContext(true))
|
||||
{
|
||||
db.ChangeTracker.AutoDetectChangesEnabled = false;
|
||||
db.ChangeTracker.QueryTrackingBehavior = QueryTrackingBehavior.NoTracking;
|
||||
await using var context = contextFactory.CreateContext(false);
|
||||
var thirtyDaysAgo = DateTime.UtcNow.AddMonths(-1);
|
||||
|
||||
var thirtyDaysAgo = DateTime.UtcNow.AddMonths(-1);
|
||||
var iqStats = (from stats in context.Set<EFClientStatistics>()
|
||||
join client in context.Clients
|
||||
on stats.ClientId equals client.ClientId
|
||||
join alias in context.Aliases
|
||||
on client.CurrentAliasId equals alias.AliasId
|
||||
where stats.ServerId == serverId
|
||||
where client.Level != EFClient.Permission.Banned
|
||||
where client.LastConnection >= thirtyDaysAgo
|
||||
orderby stats.TimePlayed descending
|
||||
select new
|
||||
{
|
||||
alias.Name,
|
||||
client.TotalConnectionTime,
|
||||
stats.Kills
|
||||
})
|
||||
.Take(5);
|
||||
|
||||
var iqStats = (from stats in db.Set<EFClientStatistics>()
|
||||
join client in db.Clients
|
||||
on stats.ClientId equals client.ClientId
|
||||
join alias in db.Aliases
|
||||
on client.CurrentAliasId equals alias.AliasId
|
||||
where stats.ServerId == serverId
|
||||
where client.Level != EFClient.Permission.Banned
|
||||
where client.LastConnection >= thirtyDaysAgo
|
||||
orderby stats.TimePlayed descending
|
||||
select new
|
||||
{
|
||||
alias.Name,
|
||||
client.TotalConnectionTime,
|
||||
stats.Kills
|
||||
})
|
||||
.Take(5);
|
||||
var iqList = await iqStats.ToListAsync();
|
||||
|
||||
var iqList = await iqStats.ToListAsync();
|
||||
|
||||
mostPlayed.AddRange(iqList.Select(stats => translationLookup["COMMANDS_MOST_PLAYED_FORMAT"].FormatExt(stats.Name, stats.Kills, (DateTime.UtcNow - DateTime.UtcNow.AddSeconds(-stats.TotalConnectionTime)).HumanizeForCurrentCulture())));
|
||||
}
|
||||
mostPlayed.AddRange(iqList.Select(stats => translationLookup["COMMANDS_MOST_PLAYED_FORMAT"].FormatExt(stats.Name, stats.Kills, (DateTime.UtcNow - DateTime.UtcNow.AddSeconds(-stats.TotalConnectionTime)).HumanizeForCurrentCulture())));
|
||||
|
||||
|
||||
return mostPlayed;
|
||||
}
|
||||
|
||||
private readonly CommandConfiguration _config;
|
||||
private readonly IDatabaseContextFactory _contextFactory;
|
||||
|
||||
public MostPlayedCommand(CommandConfiguration config, ITranslationLookup translationLookup) : base(config, translationLookup)
|
||||
public MostPlayedCommand(CommandConfiguration config, ITranslationLookup translationLookup,
|
||||
IDatabaseContextFactory contextFactory) : base(config, translationLookup)
|
||||
{
|
||||
Name = "mostplayed";
|
||||
Description = translationLookup["PLUGINS_STATS_COMMANDS_MOSTPLAYED_DESC"];
|
||||
@ -69,11 +66,12 @@ namespace IW4MAdmin.Plugins.Stats.Commands
|
||||
RequiresTarget = false;
|
||||
|
||||
_config = config;
|
||||
_contextFactory = contextFactory;
|
||||
}
|
||||
|
||||
public override async Task ExecuteAsync(GameEvent E)
|
||||
{
|
||||
var topStats = await GetMostPlayed(E.Owner, _translationLookup);
|
||||
var topStats = await GetMostPlayed(E.Owner, _translationLookup, _contextFactory);
|
||||
if (!E.Message.IsBroadcastCommand(_config.BroadcastCommandPrefix))
|
||||
{
|
||||
foreach (var stat in topStats)
|
||||
|
@ -12,14 +12,17 @@ namespace IW4MAdmin.Plugins.Stats.Commands
|
||||
{
|
||||
public class ResetStats : Command
|
||||
{
|
||||
public ResetStats(CommandConfiguration config, ITranslationLookup translationLookup) : base(config, translationLookup)
|
||||
private readonly IDatabaseContextFactory _contextFactory;
|
||||
|
||||
public ResetStats(CommandConfiguration config, ITranslationLookup translationLookup,
|
||||
IDatabaseContextFactory contextFactory) : base(config, translationLookup)
|
||||
{
|
||||
Name = "resetstats";
|
||||
Description = translationLookup["PLUGINS_STATS_COMMANDS_RESET_DESC"];
|
||||
Alias = "rs";
|
||||
Permission = EFClient.Permission.User;
|
||||
RequiresTarget = false;
|
||||
//AllowImpersonation = true;
|
||||
AllowImpersonation = true;
|
||||
}
|
||||
|
||||
public override async Task ExecuteAsync(GameEvent E)
|
||||
@ -30,27 +33,24 @@ namespace IW4MAdmin.Plugins.Stats.Commands
|
||||
long serverId = Helpers.StatManager.GetIdForServer(E.Owner);
|
||||
|
||||
EFClientStatistics clientStats;
|
||||
using (var ctx = new DatabaseContext(disableTracking: true))
|
||||
{
|
||||
clientStats = await ctx.Set<EFClientStatistics>()
|
||||
.Where(s => s.ClientId == E.Origin.ClientId)
|
||||
.Where(s => s.ServerId == serverId)
|
||||
.FirstAsync();
|
||||
await using var context = _contextFactory.CreateContext();
|
||||
clientStats = await context.Set<EFClientStatistics>()
|
||||
.Where(s => s.ClientId == E.Origin.ClientId)
|
||||
.Where(s => s.ServerId == serverId)
|
||||
.FirstAsync();
|
||||
|
||||
clientStats.Deaths = 0;
|
||||
clientStats.Kills = 0;
|
||||
clientStats.SPM = 0.0;
|
||||
clientStats.Skill = 0.0;
|
||||
clientStats.TimePlayed = 0;
|
||||
// todo: make this more dynamic
|
||||
clientStats.EloRating = 200.0;
|
||||
clientStats.Deaths = 0;
|
||||
clientStats.Kills = 0;
|
||||
clientStats.SPM = 0.0;
|
||||
clientStats.Skill = 0.0;
|
||||
clientStats.TimePlayed = 0;
|
||||
// todo: make this more dynamic
|
||||
clientStats.EloRating = 200.0;
|
||||
|
||||
// reset the cached version
|
||||
Plugin.Manager.ResetStats(E.Origin);
|
||||
// reset the cached version
|
||||
Plugin.Manager.ResetStats(E.Origin);
|
||||
|
||||
// fixme: this doesn't work properly when another context exists
|
||||
await ctx.SaveChangesAsync();
|
||||
}
|
||||
await context.SaveChangesAsync();
|
||||
E.Origin.Tell(_translationLookup["PLUGINS_STATS_COMMANDS_RESET_SUCCESS"]);
|
||||
}
|
||||
|
||||
|
@ -16,7 +16,7 @@ namespace IW4MAdmin.Plugins.Stats.Commands
|
||||
{
|
||||
class TopStats : Command
|
||||
{
|
||||
public static async Task<List<string>> GetTopStats(Server s, ITranslationLookup translationLookup)
|
||||
public static async Task<List<string>> GetTopStats(Server s, ITranslationLookup translationLookup, IDatabaseContextFactory contextFactory)
|
||||
{
|
||||
long serverId = StatManager.GetIdForServer(s);
|
||||
var topStatsText = new List<string>()
|
||||
@ -24,36 +24,34 @@ namespace IW4MAdmin.Plugins.Stats.Commands
|
||||
$"^5--{translationLookup["PLUGINS_STATS_COMMANDS_TOP_TEXT"]}--"
|
||||
};
|
||||
|
||||
using (var db = new DatabaseContext(true))
|
||||
{
|
||||
var fifteenDaysAgo = DateTime.UtcNow.AddDays(-15);
|
||||
int minPlayTime = Plugin.Config.Configuration().TopPlayersMinPlayTime;
|
||||
await using var context = contextFactory.CreateContext(false);
|
||||
var fifteenDaysAgo = DateTime.UtcNow.AddDays(-15);
|
||||
int minPlayTime = Plugin.Config.Configuration().TopPlayersMinPlayTime;
|
||||
|
||||
var iqStats = (from stats in db.Set<EFClientStatistics>()
|
||||
join client in db.Clients
|
||||
on stats.ClientId equals client.ClientId
|
||||
join alias in db.Aliases
|
||||
on client.CurrentAliasId equals alias.AliasId
|
||||
where stats.ServerId == serverId
|
||||
where stats.TimePlayed >= minPlayTime
|
||||
where client.Level != EFClient.Permission.Banned
|
||||
where client.LastConnection >= fifteenDaysAgo
|
||||
orderby (stats.EloRating + stats.Skill) / 2.0d descending
|
||||
select new
|
||||
{
|
||||
stats.KDR,
|
||||
stats.Performance,
|
||||
alias.Name
|
||||
})
|
||||
.Take(5);
|
||||
var iqStats = (from stats in context.Set<EFClientStatistics>()
|
||||
join client in context.Clients
|
||||
on stats.ClientId equals client.ClientId
|
||||
join alias in context.Aliases
|
||||
on client.CurrentAliasId equals alias.AliasId
|
||||
where stats.ServerId == serverId
|
||||
where stats.TimePlayed >= minPlayTime
|
||||
where client.Level != EFClient.Permission.Banned
|
||||
where client.LastConnection >= fifteenDaysAgo
|
||||
orderby (stats.EloRating + stats.Skill) / 2.0d descending
|
||||
select new
|
||||
{
|
||||
stats.KDR,
|
||||
stats.Performance,
|
||||
alias.Name
|
||||
})
|
||||
.Take(5);
|
||||
|
||||
var statsList = (await iqStats.ToListAsync())
|
||||
.Select(stats => $"^3{stats.Name}^7 - ^5{stats.KDR} ^7{translationLookup["PLUGINS_STATS_TEXT_KDR"]} | ^5{stats.Performance} ^7{translationLookup["PLUGINS_STATS_COMMANDS_PERFORMANCE"]}");
|
||||
var statsList = (await iqStats.ToListAsync())
|
||||
.Select(stats => $"^3{stats.Name}^7 - ^5{stats.KDR} ^7{translationLookup["PLUGINS_STATS_TEXT_KDR"]} | ^5{stats.Performance} ^7{translationLookup["PLUGINS_STATS_COMMANDS_PERFORMANCE"]}");
|
||||
|
||||
topStatsText.AddRange(statsList);
|
||||
}
|
||||
topStatsText.AddRange(statsList);
|
||||
|
||||
// no one qualified
|
||||
// no one qualified
|
||||
if (topStatsText.Count == 1)
|
||||
{
|
||||
topStatsText = new List<string>()
|
||||
@ -66,8 +64,10 @@ namespace IW4MAdmin.Plugins.Stats.Commands
|
||||
}
|
||||
|
||||
private readonly CommandConfiguration _config;
|
||||
private readonly IDatabaseContextFactory _contextFactory;
|
||||
|
||||
public TopStats(CommandConfiguration config, ITranslationLookup translationLookup) : base(config, translationLookup)
|
||||
public TopStats(CommandConfiguration config, ITranslationLookup translationLookup,
|
||||
IDatabaseContextFactory contextFactory) : base(config, translationLookup)
|
||||
{
|
||||
Name = "topstats";
|
||||
Description = translationLookup["PLUGINS_STATS_COMMANDS_TOP_DESC"];
|
||||
@ -76,11 +76,12 @@ namespace IW4MAdmin.Plugins.Stats.Commands
|
||||
RequiresTarget = false;
|
||||
|
||||
_config = config;
|
||||
_contextFactory = contextFactory;
|
||||
}
|
||||
|
||||
public override async Task ExecuteAsync(GameEvent E)
|
||||
{
|
||||
var topStats = await GetTopStats(E.Owner, _translationLookup);
|
||||
var topStats = await GetTopStats(E.Owner, _translationLookup, _contextFactory);
|
||||
if (!E.Message.IsBroadcastCommand(_config.BroadcastCommandPrefix))
|
||||
{
|
||||
foreach (var stat in topStats)
|
||||
|
@ -14,7 +14,10 @@ namespace IW4MAdmin.Plugins.Stats.Commands
|
||||
{
|
||||
public class ViewStatsCommand : Command
|
||||
{
|
||||
public ViewStatsCommand(CommandConfiguration config, ITranslationLookup translationLookup) : base(config, translationLookup)
|
||||
private readonly IDatabaseContextFactory _contextFactory;
|
||||
|
||||
public ViewStatsCommand(CommandConfiguration config, ITranslationLookup translationLookup,
|
||||
IDatabaseContextFactory contextFactory) : base(config, translationLookup)
|
||||
{
|
||||
|
||||
Name = "stats";
|
||||
@ -32,6 +35,7 @@ namespace IW4MAdmin.Plugins.Stats.Commands
|
||||
};
|
||||
|
||||
_config = config;
|
||||
_contextFactory = contextFactory;
|
||||
}
|
||||
|
||||
private readonly CommandConfiguration _config;
|
||||
@ -66,10 +70,8 @@ namespace IW4MAdmin.Plugins.Stats.Commands
|
||||
|
||||
else
|
||||
{
|
||||
using (var ctx = new DatabaseContext(true))
|
||||
{
|
||||
pStats = (await ctx.Set<EFClientStatistics>().FirstAsync(c => c.ServerId == serverId && c.ClientId == E.Target.ClientId));
|
||||
}
|
||||
await using var context = _contextFactory.CreateContext(false);
|
||||
pStats = (await context.Set<EFClientStatistics>().FirstAsync(c => c.ServerId == serverId && c.ClientId == E.Target.ClientId));
|
||||
}
|
||||
statLine = $"^5{pStats.Kills} ^7{_translationLookup["PLUGINS_STATS_TEXT_KILLS"]} | ^5{pStats.Deaths} ^7{_translationLookup["PLUGINS_STATS_TEXT_DEATHS"]} | ^5{pStats.KDR} ^7KDR | ^5{pStats.Performance} ^7{_translationLookup["PLUGINS_STATS_COMMANDS_PERFORMANCE"].ToUpper()} | {performanceRankingString}";
|
||||
}
|
||||
@ -86,10 +88,8 @@ namespace IW4MAdmin.Plugins.Stats.Commands
|
||||
|
||||
else
|
||||
{
|
||||
using (var ctx = new DatabaseContext(true))
|
||||
{
|
||||
pStats = (await ctx.Set<EFClientStatistics>().FirstAsync(c => c.ServerId == serverId && c.ClientId == E.Origin.ClientId));
|
||||
}
|
||||
await using var context = _contextFactory.CreateContext(false);
|
||||
pStats = (await context.Set<EFClientStatistics>().FirstAsync(c => c.ServerId == serverId && c.ClientId == E.Origin.ClientId));
|
||||
}
|
||||
statLine = $"^5{pStats.Kills} ^7{_translationLookup["PLUGINS_STATS_TEXT_KILLS"]} | ^5{pStats.Deaths} ^7{_translationLookup["PLUGINS_STATS_TEXT_DEATHS"]} | ^5{pStats.KDR} ^7KDR | ^5{pStats.Performance} ^7{_translationLookup["PLUGINS_STATS_COMMANDS_PERFORMANCE"].ToUpper()} | {performanceRankingString}";
|
||||
}
|
||||
|
@ -47,10 +47,8 @@ namespace IW4MAdmin.Plugins.Stats.Helpers
|
||||
|
||||
private void SetupServerIds()
|
||||
{
|
||||
using (var ctx = _contextFactory.CreateContext(enableTracking: false))
|
||||
{
|
||||
serverModels = ctx.Set<EFServer>().ToList();
|
||||
}
|
||||
using var ctx = _contextFactory.CreateContext(enableTracking: false);
|
||||
serverModels = ctx.Set<EFServer>().ToList();
|
||||
}
|
||||
|
||||
public Expression<Func<EFRating, bool>> GetRankingFunc(long? serverId = null)
|
||||
|
@ -25,10 +25,12 @@ namespace Stats.Models
|
||||
|
||||
builder.Entity<EFRating>()
|
||||
.HasIndex(p => new { p.When, p.ServerId, p.Performance, p.ActivityAmount });
|
||||
|
||||
builder.Entity<EFClientMessage>()
|
||||
.HasIndex(p => p.TimeSent);
|
||||
|
||||
builder.Entity<EFClientMessage>(message =>
|
||||
{
|
||||
message.HasIndex(p => p.TimeSent);
|
||||
});
|
||||
|
||||
// force pluralization
|
||||
builder.Entity<EFClientKill>().ToTable("EFClientKills");
|
||||
builder.Entity<EFClientMessage>().ToTable("EFClientMessages");
|
||||
|
@ -391,32 +391,28 @@ namespace IW4MAdmin.Plugins.Stats
|
||||
|
||||
async Task<string> totalKills(Server server)
|
||||
{
|
||||
using (var ctx = new DatabaseContext(disableTracking: true))
|
||||
{
|
||||
long kills = await ctx.Set<EFServerStatistics>().Where(s => s.Active).SumAsync(s => s.TotalKills);
|
||||
return kills.ToString("#,##0", new System.Globalization.CultureInfo(Utilities.CurrentLocalization.LocalizationName));
|
||||
}
|
||||
await using var context = _databaseContextFactory.CreateContext(false);
|
||||
long kills = await context.Set<EFServerStatistics>().Where(s => s.Active).SumAsync(s => s.TotalKills);
|
||||
return kills.ToString("#,##0", new System.Globalization.CultureInfo(Utilities.CurrentLocalization.LocalizationName));
|
||||
}
|
||||
|
||||
async Task<string> totalPlayTime(Server server)
|
||||
{
|
||||
using (var ctx = new DatabaseContext(disableTracking: true))
|
||||
{
|
||||
long playTime = await ctx.Set<EFServerStatistics>().Where(s => s.Active).SumAsync(s => s.TotalPlayTime);
|
||||
return (playTime / 3600.0).ToString("#,##0", new System.Globalization.CultureInfo(Utilities.CurrentLocalization.LocalizationName));
|
||||
}
|
||||
await using var context = _databaseContextFactory.CreateContext(false);
|
||||
long playTime = await context.Set<EFServerStatistics>().Where(s => s.Active).SumAsync(s => s.TotalPlayTime);
|
||||
return (playTime / 3600.0).ToString("#,##0", new System.Globalization.CultureInfo(Utilities.CurrentLocalization.LocalizationName));
|
||||
}
|
||||
|
||||
async Task<string> topStats(Server s)
|
||||
{
|
||||
// todo: this needs to needs to be updated when we DI the lookup
|
||||
return string.Join(Environment.NewLine, await Commands.TopStats.GetTopStats(s, Utilities.CurrentLocalization.LocalizationIndex));
|
||||
return string.Join(Environment.NewLine, await Commands.TopStats.GetTopStats(s, Utilities.CurrentLocalization.LocalizationIndex, _databaseContextFactory));
|
||||
}
|
||||
|
||||
async Task<string> mostPlayed(Server s)
|
||||
{
|
||||
// todo: this needs to needs to be updated when we DI the lookup
|
||||
return string.Join(Environment.NewLine, await Commands.MostPlayedCommand.GetMostPlayed(s, Utilities.CurrentLocalization.LocalizationIndex));
|
||||
return string.Join(Environment.NewLine, await Commands.MostPlayedCommand.GetMostPlayed(s, Utilities.CurrentLocalization.LocalizationIndex, _databaseContextFactory));
|
||||
}
|
||||
|
||||
async Task<string> mostKills(Server gameServer)
|
||||
|
@ -24,14 +24,17 @@ namespace IW4MAdmin.Plugins.Web.StatsWeb.Controllers
|
||||
private readonly IManager _manager;
|
||||
private readonly IResourceQueryHelper<ChatSearchQuery, MessageResponse> _chatResourceQueryHelper;
|
||||
private readonly ITranslationLookup _translationLookup;
|
||||
private readonly IDatabaseContextFactory _contextFactory;
|
||||
|
||||
public StatsController(ILogger<StatsController> logger, IManager manager, IResourceQueryHelper<ChatSearchQuery, MessageResponse> resourceQueryHelper,
|
||||
ITranslationLookup translationLookup) : base(manager)
|
||||
public StatsController(ILogger<StatsController> logger, IManager manager, IResourceQueryHelper<ChatSearchQuery,
|
||||
MessageResponse> resourceQueryHelper, ITranslationLookup translationLookup,
|
||||
IDatabaseContextFactory contextFactory) : base(manager)
|
||||
{
|
||||
_logger = logger;
|
||||
_manager = manager;
|
||||
_chatResourceQueryHelper = resourceQueryHelper;
|
||||
_translationLookup = translationLookup;
|
||||
_contextFactory = contextFactory;
|
||||
}
|
||||
|
||||
[HttpGet]
|
||||
@ -155,49 +158,48 @@ namespace IW4MAdmin.Plugins.Web.StatsWeb.Controllers
|
||||
[Authorize]
|
||||
public async Task<IActionResult> GetAutomatedPenaltyInfoAsync(int penaltyId)
|
||||
{
|
||||
using (var ctx = new SharedLibraryCore.Database.DatabaseContext(true))
|
||||
await using var context = _contextFactory.CreateContext(false);
|
||||
|
||||
var penalty = await context.Penalties
|
||||
.Select(_penalty => new { _penalty.OffenderId, _penalty.PenaltyId, _penalty.When, _penalty.AutomatedOffense })
|
||||
.FirstOrDefaultAsync(_penalty => _penalty.PenaltyId == penaltyId);
|
||||
|
||||
if (penalty == null)
|
||||
{
|
||||
var penalty = await ctx.Penalties
|
||||
.Select(_penalty => new { _penalty.OffenderId, _penalty.PenaltyId, _penalty.When, _penalty.AutomatedOffense })
|
||||
.FirstOrDefaultAsync(_penalty => _penalty.PenaltyId == penaltyId);
|
||||
return NotFound();
|
||||
}
|
||||
|
||||
if (penalty == null)
|
||||
// todo: this can be optimized
|
||||
var iqSnapshotInfo = context.Set<Stats.Models.EFACSnapshot>()
|
||||
.Where(s => s.ClientId == penalty.OffenderId)
|
||||
.Include(s => s.LastStrainAngle)
|
||||
.Include(s => s.HitOrigin)
|
||||
.Include(s => s.HitDestination)
|
||||
.Include(s => s.CurrentViewAngle)
|
||||
.Include(s => s.PredictedViewAngles)
|
||||
.ThenInclude(_angles => _angles.Vector)
|
||||
.OrderBy(s => s.When)
|
||||
.ThenBy(s => s.Hits);
|
||||
|
||||
var penaltyInfo = await iqSnapshotInfo.ToListAsync();
|
||||
|
||||
if (penaltyInfo.Count > 0)
|
||||
{
|
||||
return View("_PenaltyInfo", penaltyInfo);
|
||||
}
|
||||
|
||||
// we want to show anything related to the automated offense
|
||||
else
|
||||
{
|
||||
return View("_MessageContext", new List<MessageResponse>
|
||||
{
|
||||
return NotFound();
|
||||
}
|
||||
|
||||
// todo: this can be optimized
|
||||
var iqSnapshotInfo = ctx.Set<Stats.Models.EFACSnapshot>()
|
||||
.Where(s => s.ClientId == penalty.OffenderId)
|
||||
.Include(s => s.LastStrainAngle)
|
||||
.Include(s => s.HitOrigin)
|
||||
.Include(s => s.HitDestination)
|
||||
.Include(s => s.CurrentViewAngle)
|
||||
.Include(s => s.PredictedViewAngles)
|
||||
.ThenInclude(_angles => _angles.Vector)
|
||||
.OrderBy(s => s.When)
|
||||
.ThenBy(s => s.Hits);
|
||||
|
||||
var penaltyInfo = await iqSnapshotInfo.ToListAsync();
|
||||
|
||||
if (penaltyInfo.Count > 0)
|
||||
{
|
||||
return View("_PenaltyInfo", penaltyInfo);
|
||||
}
|
||||
|
||||
// we want to show anything related to the automated offense
|
||||
else
|
||||
{
|
||||
return View("_MessageContext", new List<MessageResponse>
|
||||
new MessageResponse()
|
||||
{
|
||||
new MessageResponse()
|
||||
{
|
||||
ClientId = penalty.OffenderId,
|
||||
Message = penalty.AutomatedOffense,
|
||||
When = penalty.When
|
||||
}
|
||||
});
|
||||
}
|
||||
ClientId = penalty.OffenderId,
|
||||
Message = penalty.AutomatedOffense,
|
||||
When = penalty.When
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -65,10 +65,12 @@ namespace IW4MAdmin.Plugins.Welcome
|
||||
public string Name => "Welcome Plugin";
|
||||
|
||||
private readonly IConfigurationHandler<WelcomeConfiguration> _configHandler;
|
||||
private readonly IDatabaseContextFactory _contextFactory;
|
||||
|
||||
public Plugin(IConfigurationHandlerFactory configurationHandlerFactory)
|
||||
public Plugin(IConfigurationHandlerFactory configurationHandlerFactory, IDatabaseContextFactory contextFactory)
|
||||
{
|
||||
_configHandler = configurationHandlerFactory.GetConfigurationHandler<WelcomeConfiguration>("WelcomePluginSettings");
|
||||
_contextFactory = contextFactory;
|
||||
}
|
||||
|
||||
public async Task OnLoadAsync(IManager manager)
|
||||
@ -98,9 +100,9 @@ namespace IW4MAdmin.Plugins.Welcome
|
||||
{
|
||||
string penaltyReason;
|
||||
|
||||
using (var ctx = new DatabaseContext(disableTracking: true))
|
||||
await using var context = _contextFactory.CreateContext(false);
|
||||
{
|
||||
penaltyReason = await ctx.Penalties
|
||||
penaltyReason = await context.Penalties
|
||||
.Where(p => p.OffenderId == newPlayer.ClientId && p.Type == EFPenalty.PenaltyType.Flag)
|
||||
.OrderByDescending(p => p.When)
|
||||
.Select(p => p.AutomatedOffense ?? p.Offense)
|
||||
|
@ -12,7 +12,7 @@
|
||||
<Description>Welcome plugin for IW4MAdmin welcomes clients to the server</Description>
|
||||
<Copyright>2018</Copyright>
|
||||
<Configurations>Debug;Release;Prerelease</Configurations>
|
||||
<LangVersion>7.1</LangVersion>
|
||||
<LangVersion>Latest</LangVersion>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
@ -1434,7 +1434,10 @@ namespace SharedLibraryCore.Commands
|
||||
/// </summary>
|
||||
public class PruneAdminsCommand : Command
|
||||
{
|
||||
public PruneAdminsCommand(CommandConfiguration config, ITranslationLookup translationLookup) : base(config, translationLookup)
|
||||
private readonly IDatabaseContextFactory _contextFactory;
|
||||
|
||||
public PruneAdminsCommand(CommandConfiguration config, ITranslationLookup translationLookup,
|
||||
IDatabaseContextFactory contextFactory) : base(config, translationLookup)
|
||||
{
|
||||
Name = "prune";
|
||||
Description = _translationLookup["COMMANDS_PRUNE_DESC"];
|
||||
@ -1476,16 +1479,15 @@ namespace SharedLibraryCore.Commands
|
||||
List<EFClient> inactiveUsers = null;
|
||||
// todo: make an event for this
|
||||
// update user roles
|
||||
using (var context = new DatabaseContext())
|
||||
{
|
||||
var lastActive = DateTime.UtcNow.AddDays(-inactiveDays);
|
||||
inactiveUsers = await context.Clients
|
||||
.Where(c => c.Level > Permission.Flagged && c.Level <= Permission.Moderator)
|
||||
.Where(c => c.LastConnection < lastActive)
|
||||
.ToListAsync();
|
||||
inactiveUsers.ForEach(c => c.SetLevel(Permission.User, E.Origin));
|
||||
await context.SaveChangesAsync();
|
||||
}
|
||||
await using var context = _contextFactory.CreateContext();
|
||||
var lastActive = DateTime.UtcNow.AddDays(-inactiveDays);
|
||||
inactiveUsers = await context.Clients
|
||||
.Where(c => c.Level > Permission.Flagged && c.Level <= Permission.Moderator)
|
||||
.Where(c => c.LastConnection < lastActive)
|
||||
.ToListAsync();
|
||||
inactiveUsers.ForEach(c => c.SetLevel(Permission.User, E.Origin));
|
||||
await context.SaveChangesAsync();
|
||||
|
||||
E.Origin.Tell(_translationLookup["COMMANDS_PRUNE_SUCCESS"].FormatExt(inactiveUsers.Count));
|
||||
}
|
||||
}
|
||||
|
@ -2,31 +2,30 @@
|
||||
using SharedLibraryCore.Database.Models;
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using SharedLibraryCore.Interfaces;
|
||||
using static SharedLibraryCore.Database.Models.EFClient;
|
||||
|
||||
namespace SharedLibraryCore.Database
|
||||
{
|
||||
public class ContextSeed
|
||||
public static class ContextSeed
|
||||
{
|
||||
private DatabaseContext context;
|
||||
|
||||
public ContextSeed(DatabaseContext ctx)
|
||||
public static async Task Seed(IDatabaseContextFactory contextFactory, CancellationToken token)
|
||||
{
|
||||
context = ctx;
|
||||
}
|
||||
var context = contextFactory.CreateContext();
|
||||
var strategy = context.Database.CreateExecutionStrategy();
|
||||
await strategy.ExecuteAsync(async () =>
|
||||
{
|
||||
await context.Database.MigrateAsync(token);
|
||||
});
|
||||
|
||||
public async Task Seed()
|
||||
{
|
||||
context.Database.Migrate();
|
||||
|
||||
if (context.AliasLinks.Count() == 0)
|
||||
if (!await context.AliasLinks.AnyAsync(token))
|
||||
{
|
||||
var link = new EFAliasLink();
|
||||
|
||||
context.Clients.Add(new EFClient()
|
||||
{
|
||||
ClientId = 1,
|
||||
Active = false,
|
||||
Connections = 0,
|
||||
FirstConnection = DateTime.UtcNow,
|
||||
@ -44,8 +43,8 @@ namespace SharedLibraryCore.Database
|
||||
},
|
||||
});
|
||||
|
||||
await context.SaveChangesAsync();
|
||||
await context.SaveChangesAsync(token);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -15,7 +15,7 @@ using System.Threading.Tasks;
|
||||
|
||||
namespace SharedLibraryCore.Database
|
||||
{
|
||||
public class DatabaseContext : DbContext
|
||||
public abstract class DatabaseContext : DbContext
|
||||
{
|
||||
public DbSet<EFClient> Clients { get; set; }
|
||||
public DbSet<EFAlias> Aliases { get; set; }
|
||||
@ -24,88 +24,6 @@ namespace SharedLibraryCore.Database
|
||||
public DbSet<EFMeta> EFMeta { get; set; }
|
||||
public DbSet<EFChangeHistory> EFChangeHistory { get; set; }
|
||||
|
||||
static string _ConnectionString;
|
||||
static string _provider;
|
||||
private static readonly ILoggerFactory _loggerFactory = LoggerFactory.Create(builder =>
|
||||
{
|
||||
builder.AddConsole()
|
||||
.AddDebug()
|
||||
.AddFilter((category, level) => true);
|
||||
});
|
||||
|
||||
public DatabaseContext(DbContextOptions<DatabaseContext> opt) : base(opt)
|
||||
{
|
||||
}
|
||||
|
||||
public DatabaseContext()
|
||||
{
|
||||
}
|
||||
|
||||
public override void Dispose()
|
||||
{
|
||||
}
|
||||
|
||||
public DatabaseContext(bool disableTracking) : this()
|
||||
{
|
||||
if (disableTracking)
|
||||
{
|
||||
this.ChangeTracker.AutoDetectChangesEnabled = false;
|
||||
this.ChangeTracker.LazyLoadingEnabled = false;
|
||||
this.ChangeTracker.QueryTrackingBehavior = QueryTrackingBehavior.NoTracking;
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
this.ChangeTracker.AutoDetectChangesEnabled = true;
|
||||
this.ChangeTracker.LazyLoadingEnabled = true;
|
||||
this.ChangeTracker.QueryTrackingBehavior = QueryTrackingBehavior.TrackAll;
|
||||
}
|
||||
}
|
||||
|
||||
public DatabaseContext(string connStr, string provider) : this()
|
||||
{
|
||||
_ConnectionString = connStr;
|
||||
_provider = provider;
|
||||
}
|
||||
|
||||
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
|
||||
{
|
||||
//optionsBuilder.UseLoggerFactory(_loggerFactory)
|
||||
// .EnableSensitiveDataLogging();
|
||||
|
||||
if (string.IsNullOrEmpty(_ConnectionString))
|
||||
{
|
||||
string currentPath = Utilities.OperatingDirectory;
|
||||
// allows the application to find the database file
|
||||
currentPath = !RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ?
|
||||
$"{Path.DirectorySeparatorChar}{currentPath}" :
|
||||
currentPath;
|
||||
|
||||
var connectionStringBuilder = new SqliteConnectionStringBuilder { DataSource = Path.Join(currentPath, "Database", "Database.db") };
|
||||
var connectionString = connectionStringBuilder.ToString();
|
||||
var connection = new SqliteConnection(connectionString);
|
||||
|
||||
if (!optionsBuilder.IsConfigured)
|
||||
{
|
||||
optionsBuilder.UseSqlite(connection);
|
||||
}
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
switch (_provider)
|
||||
{
|
||||
default:
|
||||
case "mysql":
|
||||
optionsBuilder.UseMySql(_ConnectionString, _options => _options.EnableRetryOnFailure());
|
||||
break;
|
||||
case "postgresql":
|
||||
optionsBuilder.UseNpgsql(_ConnectionString, _options => _options.EnableRetryOnFailure());
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void SetAuditColumns()
|
||||
{
|
||||
return;
|
||||
@ -129,6 +47,24 @@ namespace SharedLibraryCore.Database
|
||||
}
|
||||
}
|
||||
|
||||
public DatabaseContext()
|
||||
{
|
||||
if (!Utilities.IsMigration)
|
||||
{
|
||||
throw new InvalidOperationException();
|
||||
}
|
||||
}
|
||||
|
||||
public DatabaseContext(DbContextOptions<DatabaseContext> options) : base(options)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
protected DatabaseContext(DbContextOptions options) : base(options)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public override Task<int> SaveChangesAsync(bool acceptAllChangesOnSuccess, CancellationToken cancellationToken = default)
|
||||
{
|
||||
SetAuditColumns();
|
||||
|
@ -0,0 +1,31 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace SharedLibraryCore.Database.MigrationContext
|
||||
{
|
||||
public class MySqlDatabaseContext : DatabaseContext
|
||||
{
|
||||
public MySqlDatabaseContext()
|
||||
{
|
||||
if (!Utilities.IsMigration)
|
||||
{
|
||||
throw new InvalidOperationException();
|
||||
}
|
||||
}
|
||||
|
||||
public MySqlDatabaseContext(DbContextOptions<MySqlDatabaseContext> options) : base(options)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
|
||||
{
|
||||
if (Utilities.IsMigration)
|
||||
{
|
||||
optionsBuilder.UseMySql("Server=127.0.0.1;Database=IW4MAdmin_Migration;Uid=root;Pwd=password;")
|
||||
.EnableDetailedErrors(true)
|
||||
.EnableSensitiveDataLogging(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,33 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace SharedLibraryCore.Database.MigrationContext
|
||||
{
|
||||
public class PostgresqlDatabaseContext : DatabaseContext
|
||||
{
|
||||
public PostgresqlDatabaseContext()
|
||||
{
|
||||
if (!Utilities.IsMigration)
|
||||
{
|
||||
throw new InvalidOperationException();
|
||||
}
|
||||
}
|
||||
|
||||
public PostgresqlDatabaseContext(DbContextOptions<PostgresqlDatabaseContext> options) : base(options)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
|
||||
{
|
||||
if (Utilities.IsMigration)
|
||||
{
|
||||
optionsBuilder.UseNpgsql(
|
||||
"Host=127.0.0.1;Database=IW4MAdmin_Migration;Username=postgres;Password=password;")
|
||||
.EnableDetailedErrors(true)
|
||||
.EnableSensitiveDataLogging(true);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
@ -0,0 +1,31 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace SharedLibraryCore.Database.MigrationContext
|
||||
{
|
||||
public class SqliteDatabaseContext : DatabaseContext
|
||||
{
|
||||
public SqliteDatabaseContext()
|
||||
{
|
||||
if (!Utilities.IsMigration)
|
||||
{
|
||||
throw new InvalidOperationException();
|
||||
}
|
||||
}
|
||||
|
||||
public SqliteDatabaseContext(DbContextOptions<SqliteDatabaseContext> options) : base(options)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
|
||||
{
|
||||
if (Utilities.IsMigration)
|
||||
{
|
||||
optionsBuilder.UseSqlite("Data Source=IW4MAdmin_Migration.db")
|
||||
.EnableDetailedErrors(true)
|
||||
.EnableSensitiveDataLogging(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -24,7 +24,6 @@ namespace SharedLibraryCore.Interfaces
|
||||
IList<EFClient> GetActiveClients();
|
||||
IConfigurationHandler<ApplicationConfiguration> GetApplicationSettings();
|
||||
ClientService GetClientService();
|
||||
AliasService GetAliasService();
|
||||
PenaltyService GetPenaltyService();
|
||||
/// <summary>
|
||||
/// enumerates the registered plugin instances
|
||||
|
@ -6,11 +6,12 @@ using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage;
|
||||
using Microsoft.EntityFrameworkCore.Storage.Internal;
|
||||
using SharedLibraryCore.Database;
|
||||
using SharedLibraryCore.Database.MigrationContext;
|
||||
using System;
|
||||
|
||||
namespace SharedLibraryCore.Migrations
|
||||
namespace SharedLibraryCore.Migrations.MySql
|
||||
{
|
||||
[DbContext(typeof(DatabaseContext))]
|
||||
[DbContext(typeof(MySqlDatabaseContext))]
|
||||
[Migration("20180409183408_InitialCreate")]
|
||||
partial class InitialCreate
|
||||
{
|
@ -4,7 +4,7 @@ using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SharedLibraryCore.Migrations
|
||||
namespace SharedLibraryCore.Migrations.MySql
|
||||
{
|
||||
public partial class InitialCreate : Migration
|
||||
{
|
@ -6,11 +6,12 @@ using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage;
|
||||
using Microsoft.EntityFrameworkCore.Storage.Internal;
|
||||
using SharedLibraryCore.Database;
|
||||
using SharedLibraryCore.Database.MigrationContext;
|
||||
using System;
|
||||
|
||||
namespace SharedLibraryCore.Migrations
|
||||
namespace SharedLibraryCore.Migrations.MySql
|
||||
{
|
||||
[DbContext(typeof(DatabaseContext))]
|
||||
[DbContext(typeof(MySqlDatabaseContext))]
|
||||
[Migration("20180502195450_Update")]
|
||||
partial class Update
|
||||
{
|
@ -2,7 +2,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SharedLibraryCore.Migrations
|
||||
namespace SharedLibraryCore.Migrations.MySql
|
||||
{
|
||||
public partial class Update : Migration
|
||||
{
|
@ -6,11 +6,12 @@ using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage;
|
||||
using Microsoft.EntityFrameworkCore.Storage.Internal;
|
||||
using SharedLibraryCore.Database;
|
||||
using SharedLibraryCore.Database.MigrationContext;
|
||||
using System;
|
||||
|
||||
namespace SharedLibraryCore.Migrations
|
||||
namespace SharedLibraryCore.Migrations.MySql
|
||||
{
|
||||
[DbContext(typeof(DatabaseContext))]
|
||||
[DbContext(typeof(MySqlDatabaseContext))]
|
||||
[Migration("20180516023249_AddEloField")]
|
||||
partial class AddEloField
|
||||
{
|
@ -2,7 +2,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SharedLibraryCore.Migrations
|
||||
namespace SharedLibraryCore.Migrations.MySql
|
||||
{
|
||||
public partial class AddEloField : Migration
|
||||
{
|
@ -6,11 +6,12 @@ using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage;
|
||||
using Microsoft.EntityFrameworkCore.Storage.Internal;
|
||||
using SharedLibraryCore.Database;
|
||||
using SharedLibraryCore.Database.MigrationContext;
|
||||
using System;
|
||||
|
||||
namespace SharedLibraryCore.Migrations
|
||||
namespace SharedLibraryCore.Migrations.MySql
|
||||
{
|
||||
[DbContext(typeof(DatabaseContext))]
|
||||
[DbContext(typeof(MySqlDatabaseContext))]
|
||||
[Migration("20180517223349_AddRollingKDR")]
|
||||
partial class AddRollingKDR
|
||||
{
|
@ -2,7 +2,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SharedLibraryCore.Migrations
|
||||
namespace SharedLibraryCore.Migrations.MySql
|
||||
{
|
||||
public partial class AddRollingKDR : Migration
|
||||
{
|
@ -5,12 +5,12 @@ using Microsoft.EntityFrameworkCore.Metadata;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage;
|
||||
using Microsoft.EntityFrameworkCore.Storage.Internal;
|
||||
using SharedLibraryCore.Database;
|
||||
using SharedLibraryCore.Database.MigrationContext;
|
||||
using System;
|
||||
|
||||
namespace SharedLibraryCore.Migrations
|
||||
namespace SharedLibraryCore.Migrations.MySql
|
||||
{
|
||||
[DbContext(typeof(DatabaseContext))]
|
||||
[DbContext(typeof(MySqlDatabaseContext))]
|
||||
[Migration("20180531212903_AddAutomatedOffenseAndRatingHistory")]
|
||||
partial class AddAutomatedOffenseAndRatingHistory
|
||||
{
|
@ -4,7 +4,7 @@ using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SharedLibraryCore.Migrations
|
||||
namespace SharedLibraryCore.Migrations.MySql
|
||||
{
|
||||
public partial class AddAutomatedOffenseAndRatingHistory : Migration
|
||||
{
|
@ -5,12 +5,12 @@ using Microsoft.EntityFrameworkCore.Metadata;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage;
|
||||
using Microsoft.EntityFrameworkCore.Storage.Internal;
|
||||
using SharedLibraryCore.Database;
|
||||
using SharedLibraryCore.Database.MigrationContext;
|
||||
using System;
|
||||
|
||||
namespace SharedLibraryCore.Migrations
|
||||
namespace SharedLibraryCore.Migrations.MySql
|
||||
{
|
||||
[DbContext(typeof(DatabaseContext))]
|
||||
[DbContext(typeof(MySqlDatabaseContext))]
|
||||
[Migration("20180601172317_AddActivityAmount")]
|
||||
partial class AddActivityAmount
|
||||
{
|
@ -2,7 +2,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SharedLibraryCore.Migrations
|
||||
namespace SharedLibraryCore.Migrations.MySql
|
||||
{
|
||||
public partial class AddActivityAmount : Migration
|
||||
{
|
@ -5,12 +5,12 @@ using Microsoft.EntityFrameworkCore.Metadata;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage;
|
||||
using Microsoft.EntityFrameworkCore.Storage.Internal;
|
||||
using SharedLibraryCore.Database;
|
||||
using SharedLibraryCore.Database.MigrationContext;
|
||||
using System;
|
||||
|
||||
namespace SharedLibraryCore.Migrations
|
||||
namespace SharedLibraryCore.Migrations.MySql
|
||||
{
|
||||
[DbContext(typeof(DatabaseContext))]
|
||||
[DbContext(typeof(MySqlDatabaseContext))]
|
||||
[Migration("20180602041758_AddClientMeta")]
|
||||
partial class AddClientMeta
|
||||
{
|
@ -4,7 +4,7 @@ using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SharedLibraryCore.Migrations
|
||||
namespace SharedLibraryCore.Migrations.MySql
|
||||
{
|
||||
public partial class AddClientMeta : Migration
|
||||
{
|
@ -5,12 +5,12 @@ using Microsoft.EntityFrameworkCore.Metadata;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage;
|
||||
using Microsoft.EntityFrameworkCore.Storage.Internal;
|
||||
using SharedLibraryCore.Database;
|
||||
using SharedLibraryCore.Database.MigrationContext;
|
||||
using System;
|
||||
|
||||
namespace SharedLibraryCore.Migrations
|
||||
namespace SharedLibraryCore.Migrations.MySql
|
||||
{
|
||||
[DbContext(typeof(DatabaseContext))]
|
||||
[DbContext(typeof(MySqlDatabaseContext))]
|
||||
[Migration("20180605191706_AddEFACSnapshots")]
|
||||
partial class AddEFACSnapshots
|
||||
{
|
@ -4,7 +4,7 @@ using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SharedLibraryCore.Migrations
|
||||
namespace SharedLibraryCore.Migrations.MySql
|
||||
{
|
||||
public partial class AddEFACSnapshots : Migration
|
||||
{
|
@ -5,12 +5,12 @@ using Microsoft.EntityFrameworkCore.Metadata;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage;
|
||||
using Microsoft.EntityFrameworkCore.Storage.Internal;
|
||||
using SharedLibraryCore.Database;
|
||||
using SharedLibraryCore.Database.MigrationContext;
|
||||
using System;
|
||||
|
||||
namespace SharedLibraryCore.Migrations
|
||||
namespace SharedLibraryCore.Migrations.MySql
|
||||
{
|
||||
[DbContext(typeof(DatabaseContext))]
|
||||
[DbContext(typeof(MySqlDatabaseContext))]
|
||||
[Migration("20180614014303_IndexForEFAlias")]
|
||||
partial class IndexForEFAlias
|
||||
{
|
@ -2,7 +2,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SharedLibraryCore.Migrations
|
||||
namespace SharedLibraryCore.Migrations.MySql
|
||||
{
|
||||
public partial class IndexForEFAlias : Migration
|
||||
{
|
@ -4,11 +4,11 @@ using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
using SharedLibraryCore.Database;
|
||||
using SharedLibraryCore.Database.MigrationContext;
|
||||
|
||||
namespace SharedLibraryCore.Migrations
|
||||
namespace SharedLibraryCore.Migrations.MySql
|
||||
{
|
||||
[DbContext(typeof(DatabaseContext))]
|
||||
[DbContext(typeof(MySqlDatabaseContext))]
|
||||
[Migration("20180902035612_AddFractionAndIsKill")]
|
||||
partial class AddFractionAndIsKill
|
||||
{
|
@ -3,7 +3,7 @@ using Microsoft.EntityFrameworkCore.Metadata;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
||||
|
||||
namespace SharedLibraryCore.Migrations
|
||||
namespace SharedLibraryCore.Migrations.MySql
|
||||
{
|
||||
public partial class AddFractionAndIsKill : Migration
|
||||
{
|
@ -4,11 +4,11 @@ using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
using SharedLibraryCore.Database;
|
||||
using SharedLibraryCore.Database.MigrationContext;
|
||||
|
||||
namespace SharedLibraryCore.Migrations
|
||||
namespace SharedLibraryCore.Migrations.MySql
|
||||
{
|
||||
[DbContext(typeof(DatabaseContext))]
|
||||
[DbContext(typeof(MySqlDatabaseContext))]
|
||||
[Migration("20180904154622_AddVisibilityPercentage")]
|
||||
partial class AddVisibilityPercentage
|
||||
{
|
@ -1,6 +1,6 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
namespace SharedLibraryCore.Migrations
|
||||
namespace SharedLibraryCore.Migrations.MySql
|
||||
{
|
||||
public partial class AddVisibilityPercentage : Migration
|
||||
{
|
@ -4,11 +4,11 @@ using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
using SharedLibraryCore.Database;
|
||||
using SharedLibraryCore.Database.MigrationContext;
|
||||
|
||||
namespace SharedLibraryCore.Migrations
|
||||
namespace SharedLibraryCore.Migrations.MySql
|
||||
{
|
||||
[DbContext(typeof(DatabaseContext))]
|
||||
[DbContext(typeof(MySqlDatabaseContext))]
|
||||
[Migration("20180907020706_AddVision")]
|
||||
partial class AddVision
|
||||
{
|
@ -1,6 +1,6 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
namespace SharedLibraryCore.Migrations
|
||||
namespace SharedLibraryCore.Migrations.MySql
|
||||
{
|
||||
public partial class AddVision : Migration
|
||||
{
|
@ -4,11 +4,11 @@ using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
using SharedLibraryCore.Database;
|
||||
using SharedLibraryCore.Database.MigrationContext;
|
||||
|
||||
namespace SharedLibraryCore.Migrations
|
||||
namespace SharedLibraryCore.Migrations.MySql
|
||||
{
|
||||
[DbContext(typeof(DatabaseContext))]
|
||||
[DbContext(typeof(MySqlDatabaseContext))]
|
||||
[Migration("20180908004053_AddWhenToRating")]
|
||||
partial class AddWhenToRating
|
||||
{
|
@ -1,7 +1,7 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
namespace SharedLibraryCore.Migrations
|
||||
namespace SharedLibraryCore.Migrations.MySql
|
||||
{
|
||||
public partial class AddWhenToRating : Migration
|
||||
{
|
@ -4,11 +4,11 @@ using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
using SharedLibraryCore.Database;
|
||||
using SharedLibraryCore.Database.MigrationContext;
|
||||
|
||||
namespace SharedLibraryCore.Migrations
|
||||
namespace SharedLibraryCore.Migrations.MySql
|
||||
{
|
||||
[DbContext(typeof(DatabaseContext))]
|
||||
[DbContext(typeof(MySqlDatabaseContext))]
|
||||
[Migration("20180910221749_AddRatingIndexes")]
|
||||
partial class AddRatingIndexes
|
||||
{
|
@ -1,6 +1,6 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
namespace SharedLibraryCore.Migrations
|
||||
namespace SharedLibraryCore.Migrations.MySql
|
||||
{
|
||||
public partial class AddRatingIndexes : Migration
|
||||
{
|
@ -4,11 +4,11 @@ using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
using SharedLibraryCore.Database;
|
||||
using SharedLibraryCore.Database.MigrationContext;
|
||||
|
||||
namespace SharedLibraryCore.Migrations
|
||||
namespace SharedLibraryCore.Migrations.MySql
|
||||
{
|
||||
[DbContext(typeof(DatabaseContext))]
|
||||
[DbContext(typeof(MySqlDatabaseContext))]
|
||||
[Migration("20180911184224_AddEFAliasNameIndex")]
|
||||
partial class AddEFAliasNameIndex
|
||||
{
|
@ -1,6 +1,6 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
namespace SharedLibraryCore.Migrations
|
||||
namespace SharedLibraryCore.Migrations.MySql
|
||||
{
|
||||
public partial class AddEFAliasNameIndex : Migration
|
||||
{
|
@ -4,11 +4,11 @@ using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
using SharedLibraryCore.Database;
|
||||
using SharedLibraryCore.Database.MigrationContext;
|
||||
|
||||
namespace SharedLibraryCore.Migrations
|
||||
namespace SharedLibraryCore.Migrations.MySql
|
||||
{
|
||||
[DbContext(typeof(DatabaseContext))]
|
||||
[DbContext(typeof(MySqlDatabaseContext))]
|
||||
[Migration("20180911190823_AddEFAliasNameMaxLength24")]
|
||||
partial class AddEFAliasNameMaxLength24
|
||||
{
|
@ -1,6 +1,6 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
namespace SharedLibraryCore.Migrations
|
||||
namespace SharedLibraryCore.Migrations.MySql
|
||||
{
|
||||
public partial class AddEFAliasNameMaxLength24 : Migration
|
||||
{
|
@ -4,11 +4,11 @@ using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
using SharedLibraryCore.Database;
|
||||
using SharedLibraryCore.Database.MigrationContext;
|
||||
|
||||
namespace SharedLibraryCore.Migrations
|
||||
namespace SharedLibraryCore.Migrations.MySql
|
||||
{
|
||||
[DbContext(typeof(DatabaseContext))]
|
||||
[DbContext(typeof(MySqlDatabaseContext))]
|
||||
[Migration("20180912015012_AddPreviousCurrentValueToEFChangeHistory")]
|
||||
partial class AddPreviousCurrentValueToEFChangeHistory
|
||||
{
|
@ -1,6 +1,6 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
namespace SharedLibraryCore.Migrations
|
||||
namespace SharedLibraryCore.Migrations.MySql
|
||||
{
|
||||
public partial class AddPreviousCurrentValueToEFChangeHistory : Migration
|
||||
{
|
@ -4,11 +4,11 @@ using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
using SharedLibraryCore.Database;
|
||||
using SharedLibraryCore.Database.MigrationContext;
|
||||
|
||||
namespace SharedLibraryCore.Migrations
|
||||
namespace SharedLibraryCore.Migrations.MySql
|
||||
{
|
||||
[DbContext(typeof(DatabaseContext))]
|
||||
[DbContext(typeof(MySqlDatabaseContext))]
|
||||
[Migration("20180915163111_AddIndexToMessageTimeSent")]
|
||||
partial class AddIndexToMessageTimeSent
|
||||
{
|
@ -1,6 +1,6 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
namespace SharedLibraryCore.Migrations
|
||||
namespace SharedLibraryCore.Migrations.MySql
|
||||
{
|
||||
public partial class AddIndexToMessageTimeSent : Migration
|
||||
{
|
@ -4,11 +4,11 @@ using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
using SharedLibraryCore.Database;
|
||||
using SharedLibraryCore.Database.MigrationContext;
|
||||
|
||||
namespace SharedLibraryCore.Migrations
|
||||
namespace SharedLibraryCore.Migrations.MySql
|
||||
{
|
||||
[DbContext(typeof(DatabaseContext))]
|
||||
[DbContext(typeof(MySqlDatabaseContext))]
|
||||
[Migration("20180922231310_RemoveACSnapShot")]
|
||||
partial class RemoveACSnapShot
|
||||
{
|
@ -3,7 +3,7 @@ using Microsoft.EntityFrameworkCore.Metadata;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
||||
|
||||
namespace SharedLibraryCore.Migrations
|
||||
namespace SharedLibraryCore.Migrations.MySql
|
||||
{
|
||||
public partial class RemoveACSnapShot : Migration
|
||||
{
|
@ -4,11 +4,11 @@ using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
using SharedLibraryCore.Database;
|
||||
using SharedLibraryCore.Database.MigrationContext;
|
||||
|
||||
namespace SharedLibraryCore.Migrations
|
||||
namespace SharedLibraryCore.Migrations.MySql
|
||||
{
|
||||
[DbContext(typeof(DatabaseContext))]
|
||||
[DbContext(typeof(MySqlDatabaseContext))]
|
||||
[Migration("20180922231600_ReaddACSnapshot")]
|
||||
partial class ReaddACSnapshot
|
||||
{
|
@ -3,7 +3,7 @@ using Microsoft.EntityFrameworkCore.Metadata;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
||||
|
||||
namespace SharedLibraryCore.Migrations
|
||||
namespace SharedLibraryCore.Migrations.MySql
|
||||
{
|
||||
public partial class ReaddACSnapshot : Migration
|
||||
{
|
@ -4,11 +4,11 @@ using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
using SharedLibraryCore.Database;
|
||||
using SharedLibraryCore.Database.MigrationContext;
|
||||
|
||||
namespace SharedLibraryCore.Migrations
|
||||
namespace SharedLibraryCore.Migrations.MySql
|
||||
{
|
||||
[DbContext(typeof(DatabaseContext))]
|
||||
[DbContext(typeof(MySqlDatabaseContext))]
|
||||
[Migration("20181014171848_MakePenaltyExpirationNullable")]
|
||||
partial class MakePenaltyExpirationNullable
|
||||
{
|
@ -1,7 +1,7 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
namespace SharedLibraryCore.Migrations
|
||||
namespace SharedLibraryCore.Migrations.MySql
|
||||
{
|
||||
public partial class MakePenaltyExpirationNullable : Migration
|
||||
{
|
@ -4,11 +4,11 @@ using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
using SharedLibraryCore.Database;
|
||||
using SharedLibraryCore.Database.MigrationContext;
|
||||
|
||||
namespace SharedLibraryCore.Migrations
|
||||
namespace SharedLibraryCore.Migrations.MySql
|
||||
{
|
||||
[DbContext(typeof(DatabaseContext))]
|
||||
[DbContext(typeof(MySqlDatabaseContext))]
|
||||
[Migration("20181125193243_MakeClientIPNullable")]
|
||||
partial class MakeClientIPNullable
|
||||
{
|
@ -1,6 +1,6 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
namespace SharedLibraryCore.Migrations
|
||||
namespace SharedLibraryCore.Migrations.MySql
|
||||
{
|
||||
public partial class MakeClientIPNullable : Migration
|
||||
{
|
@ -4,11 +4,11 @@ using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
using SharedLibraryCore.Database;
|
||||
using SharedLibraryCore.Database.MigrationContext;
|
||||
|
||||
namespace SharedLibraryCore.Migrations
|
||||
namespace SharedLibraryCore.Migrations.MySql
|
||||
{
|
||||
[DbContext(typeof(DatabaseContext))]
|
||||
[DbContext(typeof(MySqlDatabaseContext))]
|
||||
[Migration("20181127144417_AddEndpointToEFServerUpdateServerIdType")]
|
||||
partial class AddEndpointToEFServerUpdateServerIdType
|
||||
{
|
@ -1,6 +1,6 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
namespace SharedLibraryCore.Migrations
|
||||
namespace SharedLibraryCore.Migrations.MySql
|
||||
{
|
||||
public partial class AddEndpointToEFServerUpdateServerIdType : Migration
|
||||
{
|
@ -4,11 +4,11 @@ using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
using SharedLibraryCore.Database;
|
||||
using SharedLibraryCore.Database.MigrationContext;
|
||||
|
||||
namespace SharedLibraryCore.Migrations
|
||||
namespace SharedLibraryCore.Migrations.MySql
|
||||
{
|
||||
[DbContext(typeof(DatabaseContext))]
|
||||
[DbContext(typeof(MySqlDatabaseContext))]
|
||||
[Migration("20181216214513_AddEvadePenaltyFlag")]
|
||||
partial class AddEvadePenaltyFlag
|
||||
{
|
@ -1,6 +1,6 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
namespace SharedLibraryCore.Migrations
|
||||
namespace SharedLibraryCore.Migrations.MySql
|
||||
{
|
||||
public partial class AddEvadePenaltyFlag : Migration
|
||||
{
|
@ -4,11 +4,11 @@ using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
using SharedLibraryCore.Database;
|
||||
using SharedLibraryCore.Database.MigrationContext;
|
||||
|
||||
namespace SharedLibraryCore.Migrations
|
||||
namespace SharedLibraryCore.Migrations.MySql
|
||||
{
|
||||
[DbContext(typeof(DatabaseContext))]
|
||||
[DbContext(typeof(MySqlDatabaseContext))]
|
||||
[Migration("20190222234742_AddIndexToEFMeta-KeyAndClientId")]
|
||||
partial class AddIndexToEFMetaKeyAndClientId
|
||||
{
|
@ -1,6 +1,6 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
namespace SharedLibraryCore.Migrations
|
||||
namespace SharedLibraryCore.Migrations.MySql
|
||||
{
|
||||
public partial class AddIndexToEFMetaKeyAndClientId : Migration
|
||||
{
|
@ -4,11 +4,11 @@ using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
using SharedLibraryCore.Database;
|
||||
using SharedLibraryCore.Database.MigrationContext;
|
||||
|
||||
namespace SharedLibraryCore.Migrations
|
||||
namespace SharedLibraryCore.Migrations.MySql
|
||||
{
|
||||
[DbContext(typeof(DatabaseContext))]
|
||||
[DbContext(typeof(MySqlDatabaseContext))]
|
||||
[Migration("20190423142128_AddGameNameToEFServer")]
|
||||
partial class AddGameNameToEFServer
|
||||
{
|
@ -1,6 +1,6 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
namespace SharedLibraryCore.Migrations
|
||||
namespace SharedLibraryCore.Migrations.MySql
|
||||
{
|
||||
public partial class AddGameNameToEFServer : Migration
|
||||
{
|
@ -4,11 +4,11 @@ using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
using SharedLibraryCore.Database;
|
||||
using SharedLibraryCore.Database.MigrationContext;
|
||||
|
||||
namespace SharedLibraryCore.Migrations
|
||||
namespace SharedLibraryCore.Migrations.MySql
|
||||
{
|
||||
[DbContext(typeof(DatabaseContext))]
|
||||
[DbContext(typeof(MySqlDatabaseContext))]
|
||||
[Migration("20190615145212_AddAvgRecoilOffset")]
|
||||
partial class AddAvgRecoilOffset
|
||||
{
|
@ -1,6 +1,6 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
namespace SharedLibraryCore.Migrations
|
||||
namespace SharedLibraryCore.Migrations.MySql
|
||||
{
|
||||
public partial class AddAvgRecoilOffset : Migration
|
||||
{
|
@ -4,11 +4,11 @@ using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
using SharedLibraryCore.Database;
|
||||
using SharedLibraryCore.Database.MigrationContext;
|
||||
|
||||
namespace SharedLibraryCore.Migrations
|
||||
namespace SharedLibraryCore.Migrations.MySql
|
||||
{
|
||||
[DbContext(typeof(DatabaseContext))]
|
||||
[DbContext(typeof(MySqlDatabaseContext))]
|
||||
[Migration("20190615214055_AddRecoilOffsetToSnapshot")]
|
||||
partial class AddRecoilOffsetToSnapshot
|
||||
{
|
@ -1,6 +1,6 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
namespace SharedLibraryCore.Migrations
|
||||
namespace SharedLibraryCore.Migrations.MySql
|
||||
{
|
||||
public partial class AddRecoilOffsetToSnapshot : Migration
|
||||
{
|
@ -4,11 +4,11 @@ using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
using SharedLibraryCore.Database;
|
||||
using SharedLibraryCore.Database.MigrationContext;
|
||||
|
||||
namespace SharedLibraryCore.Migrations
|
||||
namespace SharedLibraryCore.Migrations.MySql
|
||||
{
|
||||
[DbContext(typeof(DatabaseContext))]
|
||||
[DbContext(typeof(MySqlDatabaseContext))]
|
||||
[Migration("20190725000309_AlterEFRatingIndex")]
|
||||
partial class AlterEFRatingIndex
|
||||
{
|
@ -1,6 +1,6 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
namespace SharedLibraryCore.Migrations
|
||||
namespace SharedLibraryCore.Migrations.MySql
|
||||
{
|
||||
public partial class AlterEFRatingIndex : Migration
|
||||
{
|
@ -4,11 +4,11 @@ using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
using SharedLibraryCore.Database;
|
||||
using SharedLibraryCore.Database.MigrationContext;
|
||||
|
||||
namespace SharedLibraryCore.Migrations
|
||||
namespace SharedLibraryCore.Migrations.MySql
|
||||
{
|
||||
[DbContext(typeof(DatabaseContext))]
|
||||
[DbContext(typeof(MySqlDatabaseContext))]
|
||||
[Migration("20190802174908_AddSearchNameToEFAlias")]
|
||||
partial class AddSearchNameToEFAlias
|
||||
{
|
@ -1,6 +1,6 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
namespace SharedLibraryCore.Migrations
|
||||
namespace SharedLibraryCore.Migrations.MySql
|
||||
{
|
||||
public partial class AddSearchNameToEFAlias : Migration
|
||||
{
|
@ -4,11 +4,11 @@ using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
using SharedLibraryCore.Database;
|
||||
using SharedLibraryCore.Database.MigrationContext;
|
||||
|
||||
namespace SharedLibraryCore.Migrations
|
||||
namespace SharedLibraryCore.Migrations.MySql
|
||||
{
|
||||
[DbContext(typeof(DatabaseContext))]
|
||||
[DbContext(typeof(MySqlDatabaseContext))]
|
||||
[Migration("20190831210503_AvgSnapValueToClientStatistics")]
|
||||
partial class AvgSnapValueToClientStatistics
|
||||
{
|
@ -1,6 +1,6 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
namespace SharedLibraryCore.Migrations
|
||||
namespace SharedLibraryCore.Migrations.MySql
|
||||
{
|
||||
public partial class AvgSnapValueToClientStatistics : Migration
|
||||
{
|
@ -4,11 +4,11 @@ using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
using SharedLibraryCore.Database;
|
||||
using SharedLibraryCore.Database.MigrationContext;
|
||||
|
||||
namespace SharedLibraryCore.Migrations
|
||||
namespace SharedLibraryCore.Migrations.MySql
|
||||
{
|
||||
[DbContext(typeof(DatabaseContext))]
|
||||
[DbContext(typeof(MySqlDatabaseContext))]
|
||||
[Migration("20190901180209_AddSnapHitCountToClientStatistics")]
|
||||
partial class AddSnapHitCountToClientStatistics
|
||||
{
|
@ -1,6 +1,6 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
namespace SharedLibraryCore.Migrations
|
||||
namespace SharedLibraryCore.Migrations.MySql
|
||||
{
|
||||
public partial class AddSnapHitCountToClientStatistics : Migration
|
||||
{
|
@ -4,11 +4,11 @@ using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
using SharedLibraryCore.Database;
|
||||
using SharedLibraryCore.Database.MigrationContext;
|
||||
|
||||
namespace SharedLibraryCore.Migrations
|
||||
namespace SharedLibraryCore.Migrations.MySql
|
||||
{
|
||||
[DbContext(typeof(DatabaseContext))]
|
||||
[DbContext(typeof(MySqlDatabaseContext))]
|
||||
[Migration("20190901223620_UseJunctionTableForSnapshotVector3")]
|
||||
partial class UseJunctionTableForSnapshotVector3
|
||||
{
|
@ -2,7 +2,7 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
||||
|
||||
namespace SharedLibraryCore.Migrations
|
||||
namespace SharedLibraryCore.Migrations.MySql
|
||||
{
|
||||
public partial class UseJunctionTableForSnapshotVector3 : Migration
|
||||
{
|
@ -4,11 +4,11 @@ using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
using SharedLibraryCore.Database;
|
||||
using SharedLibraryCore.Database.MigrationContext;
|
||||
|
||||
namespace SharedLibraryCore.Migrations
|
||||
namespace SharedLibraryCore.Migrations.MySql
|
||||
{
|
||||
[DbContext(typeof(DatabaseContext))]
|
||||
[DbContext(typeof(MySqlDatabaseContext))]
|
||||
[Migration("20190914011524_AddCurrentSnapValueToSnapshot")]
|
||||
partial class AddCurrentSnapValueToSnapshot
|
||||
{
|
@ -1,6 +1,6 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
namespace SharedLibraryCore.Migrations
|
||||
namespace SharedLibraryCore.Migrations.MySql
|
||||
{
|
||||
public partial class AddCurrentSnapValueToSnapshot : Migration
|
||||
{
|
@ -4,11 +4,11 @@ using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
using SharedLibraryCore.Database;
|
||||
using SharedLibraryCore.Database.MigrationContext;
|
||||
|
||||
namespace SharedLibraryCore.Migrations
|
||||
namespace SharedLibraryCore.Migrations.MySql
|
||||
{
|
||||
[DbContext(typeof(DatabaseContext))]
|
||||
[DbContext(typeof(MySqlDatabaseContext))]
|
||||
[Migration("20190914012015_AddSessionSnapHitsToSnapshot")]
|
||||
partial class AddSessionSnapHitsToSnapshot
|
||||
{
|
@ -1,6 +1,6 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
namespace SharedLibraryCore.Migrations
|
||||
namespace SharedLibraryCore.Migrations.MySql
|
||||
{
|
||||
public partial class AddSessionSnapHitsToSnapshot : Migration
|
||||
{
|
@ -4,11 +4,11 @@ using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
using SharedLibraryCore.Database;
|
||||
using SharedLibraryCore.Database.MigrationContext;
|
||||
|
||||
namespace SharedLibraryCore.Migrations
|
||||
namespace SharedLibraryCore.Migrations.MySql
|
||||
{
|
||||
[DbContext(typeof(DatabaseContext))]
|
||||
[DbContext(typeof(MySqlDatabaseContext))]
|
||||
[Migration("20191004172550_RenameClientHitLocationCountColumns")]
|
||||
partial class RenameClientHitLocationCountColumns
|
||||
{
|
@ -1,6 +1,6 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
namespace SharedLibraryCore.Migrations
|
||||
namespace SharedLibraryCore.Migrations.MySql
|
||||
{
|
||||
public partial class RenameClientHitLocationCountColumns : Migration
|
||||
{
|
@ -4,11 +4,11 @@ using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
using SharedLibraryCore.Database;
|
||||
using SharedLibraryCore.Database.MigrationContext;
|
||||
|
||||
namespace SharedLibraryCore.Migrations
|
||||
namespace SharedLibraryCore.Migrations.MySql
|
||||
{
|
||||
[DbContext(typeof(DatabaseContext))]
|
||||
[DbContext(typeof(MySqlDatabaseContext))]
|
||||
[Migration("20191030000713_EnforceUniqueIndexForEFAliasIPName")]
|
||||
partial class EnforceUniqueIndexForEFAliasIPName
|
||||
{
|
@ -1,6 +1,6 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
namespace SharedLibraryCore.Migrations
|
||||
namespace SharedLibraryCore.Migrations.MySql
|
||||
{
|
||||
public partial class EnforceUniqueIndexForEFAliasIPName : Migration
|
||||
{
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user