Fix DbContext configuration nightmares.
Thanks to julian figuring out IDesignTimeDbContextFactory exists in #6327. All this DbContext configuration and options setup stuff is insane. Microsoft should be absolutely ashamed for coming up with this load of garbage.
This commit is contained in:
@@ -13,15 +13,12 @@ namespace Content.Server.Database
|
||||
{
|
||||
public sealed class SqliteServerDbContext : ServerDbContext
|
||||
{
|
||||
public SqliteServerDbContext()
|
||||
public SqliteServerDbContext(DbContextOptions<SqliteServerDbContext> options) : base(options)
|
||||
{
|
||||
}
|
||||
|
||||
protected override void OnConfiguring(DbContextOptionsBuilder options)
|
||||
{
|
||||
if (!InitializedWithOptions)
|
||||
options.UseSqlite("dummy connection string");
|
||||
|
||||
((IDbContextOptionsBuilderInfrastructure) options).AddOrUpdateExtension(new SnakeCaseExtension());
|
||||
|
||||
options.ConfigureWarnings(x =>
|
||||
@@ -70,10 +67,6 @@ namespace Content.Server.Database
|
||||
.HasConversion(jsonConverter);
|
||||
}
|
||||
|
||||
public SqliteServerDbContext(DbContextOptions<ServerDbContext> options) : base(options)
|
||||
{
|
||||
}
|
||||
|
||||
private static string InetToString(IPAddress address, int mask) {
|
||||
if (address.IsIPv4MappedToIPv6)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user