Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to EFCore 9 #2059

Open
wants to merge 8 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build/Version.props
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<TgsDmapiVersion>7.3.1</TgsDmapiVersion>
<TgsInteropVersion>5.10.0</TgsInteropVersion>
<TgsHostWatchdogVersion>1.6.0</TgsHostWatchdogVersion>
<TgsSwarmProtocolVersion>8.0.0</TgsSwarmProtocolVersion>
<TgsSwarmProtocolVersion>9.0.0</TgsSwarmProtocolVersion>
<TgsContainerScriptVersion>1.2.1</TgsContainerScriptVersion>
<TgsNugetNetFramework>netstandard2.0</TgsNugetNetFramework>
<TgsNetMajorVersion>8</TgsNetMajorVersion>
Expand Down
2 changes: 1 addition & 1 deletion src/Tgstation.Server.Host/.config/dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"isRoot": true,
"tools": {
"dotnet-ef": {
"version": "8.0.11",
"version": "9.0.0",
"commands": [
"dotnet-ef"
]
Expand Down
5 changes: 4 additions & 1 deletion src/Tgstation.Server.Host/Database/DatabaseContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder)
/// <summary>
/// Used by unit tests to remind us to setup the correct SQLite migration downgrades.
/// </summary>
internal static readonly Type SLLatestMigration = typeof(SLAddAutoStartAndStop);
internal static readonly Type SLLatestMigration = typeof(SLNormalizeSqlite);

/// <summary>
/// Gets the name of the migration to run for migrating down to a given <paramref name="targetVersion"/> for the <paramref name="currentDatabaseType"/>.
Expand All @@ -482,6 +482,9 @@ protected override void OnModelCreating(ModelBuilder modelBuilder)
string BadDatabaseType() => throw new ArgumentException($"Invalid DatabaseType: {currentDatabaseType}", nameof(currentDatabaseType));

// !!! DON'T FORGET TO UPDATE THE SWARM PROTOCOL MAJOR VERSION !!!
if (targetVersion < new Version(6, 13, 0) && currentDatabaseType == DatabaseType.Sqlite)
targetMigration = nameof(SLAddAutoStartAndStop);

if (targetVersion < new Version(6, 12, 0))
targetMigration = currentDatabaseType switch
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ sealed class MySqlDesignTimeDbContextFactory : IDesignTimeDbContextFactory<MySql
{
/// <inheritdoc />
public MySqlDatabaseContext CreateDbContext(string[] args)
=> new MySqlDatabaseContext(
=> new(
DesignTimeDbContextFactoryHelpers.CreateDatabaseContextOptions<MySqlDatabaseContext>(
DatabaseType.MariaDB,
"Server=127.0.0.1;User Id=root;Password=zdxfOOTlQFnklwzytzCj;Database=TGS_Design"));
Expand Down
Loading
Loading