Skip to content

Commit

Permalink
Server ban exemption system (#15076)
Browse files Browse the repository at this point in the history
  • Loading branch information
PJB3005 authored Apr 3, 2023
1 parent e037d12 commit c8e90e5
Show file tree
Hide file tree
Showing 26 changed files with 8,681 additions and 135 deletions.
10 changes: 7 additions & 3 deletions Content.Server.Database/Content.Server.Database.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,16 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="6.0.5">
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="7.0.4">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite.Core" Version="6.0.5" />
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="6.0.4" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite.Core" Version="7.0.4" />
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="7.0.3" />

<!-- Necessary at design time -->
<PackageReference Include="SQLitePCLRaw.provider.e_sqlite3" Version="2.1.4" Condition="'$(UseSystemSqlite)' != 'True' and '$(Configuration)' != 'Release'" />
<PackageReference Include="SQLitePCLRaw.bundle_e_sqlite3" Version="2.1.4" Condition="'$(UseSystemSqlite)' != 'True' and '$(Configuration)' != 'Release'" />
</ItemGroup>

<ItemGroup>
Expand Down
12 changes: 11 additions & 1 deletion Content.Server.Database/DesignTimeContextFactories.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
using Microsoft.EntityFrameworkCore;
#if TOOLS

using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Design;
using SQLitePCL;

// ReSharper disable UnusedType.Global

namespace Content.Server.Database;
Expand All @@ -18,8 +22,14 @@ public sealed class DesignTimeContextFactorySqlite : IDesignTimeDbContextFactory
{
public SqliteServerDbContext CreateDbContext(string[] args)
{
#if !USE_SYSTEM_SQLITE
raw.SetProvider(new SQLite3Provider_e_sqlite3());
#endif

var optionsBuilder = new DbContextOptionsBuilder<SqliteServerDbContext>();
optionsBuilder.UseSqlite("Data Source=:memory:");
return new SqliteServerDbContext(optionsBuilder.Options);
}
}

#endif
Loading

0 comments on commit c8e90e5

Please sign in to comment.