fix(host): wire DB migration init + Plotly CDN + attribute fix on hand-written migration

Three fixes surfaced when launching the WPF host for the first time:

1. App.xaml.cs — call MarathonDbContextInitializer.InitializeAsync()
   between Host.Build() and Host.Start() so EF migrations + WAL pragma
   are applied BEFORE BackgroundServices race to query the DB. Without
   this, all pollers crashed on 'no such table: Events'.

2. wwwroot/index.html — added <script src='https://cdn.plot.ly/plotly-2.35.2.min.js'>
   before blazor.webview.js. Phase 6 reviewer flagged this for Phase 9,
   but charts are unrenderable without it; better to ship now.

3. Migrations/20260505000000_InitialCreate.cs — added [DbContext] and
   [Migration('20260505000000_InitialCreate')] attributes. Phase 2's
   hand-written migration was missing both, so EF saw 'no migrations to
   apply' even on a fresh DB. With the attributes, the migration runs
   on first launch and creates all tables (Events, Snapshots, Bets,
   EventResults, Anomalies, Sports, Leagues).

Verified: clean DB → migration applied → all 7 tables created → pollers
run with empty results (no data yet — UpcomingEventsPoller fires every 6h
by default; first scrape will populate the DB).
This commit is contained in:
2026-05-05 13:55:59 +03:00
parent 828dcf5a08
commit 85bc99cac5
3 changed files with 18 additions and 0 deletions
+3
View File
@@ -38,6 +38,9 @@
<a class="dismiss" style="float: right; cursor: pointer; padding: 0 8px;">×</a>
</div>
<!-- Plotly.js for OddsTimeline charts (Phase 6). Pinned major version 2.x. -->
<script src="https://cdn.plot.ly/plotly-2.35.2.min.js" charset="utf-8"></script>
<script src="_framework/blazor.webview.js" autostart="false"></script>
<script src="_content/MudBlazor/MudBlazor.min.js"></script>
</body>