Phase 6 (Stufe 5): Default-Provider auf MySQL + Readback-Verifikation
- appsettings.json: Database:Provider = "MySql" (voller Umstieg). - ConfigMigrator.VerifyMySql + CLI --verify-mysql: liest Accounts, Settings, Trader, Markets aus MySQL zurueck. - Verifiziert: 3 Accounts, 3 Settings, 32 Trader (23 aktiv), 2344 Markets; Werte/AssignedAccountIds stimmen mit Exporten ueberein. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
9dbecc9514
commit
d227d24ca8
+26
@@ -41,6 +41,13 @@ internal static class Program
|
||||
return;
|
||||
}
|
||||
|
||||
// Readback-Verifikation der migrierten Config aus MySQL. Kein UI-Start.
|
||||
if (args.Length > 0 && string.Equals(args[0], "--verify-mysql", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
RunVerifyMySql();
|
||||
return;
|
||||
}
|
||||
|
||||
ApplicationConfiguration.Initialize();
|
||||
|
||||
var modules = new System.Collections.Generic.List<IPolyTraderModule>
|
||||
@@ -268,4 +275,23 @@ internal static class Program
|
||||
|
||||
Services.ConfigMigrator.RunFromJson(folder, mySql);
|
||||
}
|
||||
|
||||
private static void RunVerifyMySql()
|
||||
{
|
||||
var config = new Microsoft.Extensions.Configuration.ConfigurationBuilder()
|
||||
.SetBasePath(System.IO.Directory.GetCurrentDirectory())
|
||||
.AddJsonFile("appsettings.json", optional: true)
|
||||
.AddJsonFile("appsettings.Local.json", optional: true)
|
||||
.AddEnvironmentVariables()
|
||||
.Build();
|
||||
|
||||
var mySql = config["Database:MySqlConnectionString"] ?? string.Empty;
|
||||
if (string.IsNullOrWhiteSpace(mySql))
|
||||
{
|
||||
Console.WriteLine("FEHLER: Database:MySqlConnectionString fehlt (appsettings.Local.json).");
|
||||
return;
|
||||
}
|
||||
|
||||
Services.ConfigMigrator.VerifyMySql(mySql);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user