Phase 6 (Stufe 1): EF Core + MySQL Fundament (Core-Seite)

- Pomelo.EntityFrameworkCore.MySql 8.0.3 + EF Core Design im Core; DI.Abstractions
  auf 8.0.2 angehoben (Downgrade-Konflikt aufgeloest).
- DatabaseOptions: Provider (MySql|Mongo) + MySqlConnectionString (Connection liegt
  in gitignorierter appsettings.Local.json, NICHT im Repo).
- Position: AccountId + IsDemo ergaenzt (MySQL: eine positions-Tabelle statt
  Collection-per-Account).
- CoreDbContext (accounts/positions/markets/trade_log) mit Keys, Decimal-Praezision,
  NotMapped fuer Runtime-Felder, Text-Spalten fuer JSON. Design-Time-Factory (Env-Var).
- EF-Migration InitialCore erstellt UND auf die MySQL-DB angewandt (Tabellen live).

Naechste Stufen: Core-EF-Repos + DI-Umschaltung, Modul-Context (CopyTradingDbContext)
+ Repos, Config-Migration Mongo->MySQL, dann Mongo entfernen.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Richard
2026-07-05 13:32:06 +02:00
co-authored by Claude Opus 4.8
parent 87dd9a750d
commit 97bff61fc5
9 changed files with 939 additions and 1 deletions
+5
View File
@@ -2,6 +2,11 @@ namespace PolyTraderSharp.Models
{
public class Position
{
// Für MySQL: eine positions-Tabelle mit account_id + is_demo (in Mongo lag das
// im Collection-Namen open_positions_{id} / demo_positions_{id}).
public int AccountId { get; set; }
public bool IsDemo { get; set; }
[MongoDB.Bson.Serialization.Attributes.BsonId]
public string TokenId { get; set; } = string.Empty;
public string MarketSlug { get; set; } = string.Empty;