chore(bootstrap): refresh stale GlobalsImporter references in docs/test names

This commit is contained in:
gamer147
2026-05-26 16:44:54 -04:00
parent c02991a5c2
commit 141f34f817
19 changed files with 41 additions and 44 deletions

View File

@@ -10,9 +10,8 @@ namespace SVSim.Bootstrap.Importers;
/// Idempotent upsert of the six card-id-keyed tables from load-index seeds:
/// SpotCards, ReprintedCards, UnlimitedRestrictions, LoadingExclusionCards,
/// MaintenanceCards, FeatureMaintenances. Loads the Cards FK set once for orphan warnings.
/// Rows missing from a seed are LEFT INTACT (consistent with prior GlobalsImporter behavior)
/// for the five card-id-keyed tables; FeatureMaintenances clears-and-rewrites because its
/// synthetic ordinal Id has no natural-key semantics.
/// Rows missing from a seed are LEFT INTACT — a partial seed shouldn't silently delete entries.
/// FeatureMaintenances clears-and-rewrites because its synthetic ordinal Id has no natural-key semantics.
/// </summary>
public class CardListsImporter
{
@@ -136,10 +135,10 @@ public class CardListsImporter
var seed = SeedLoader.LoadList<FeatureMaintenanceSeed>(Path.Combine(seedDir, "feature-maintenances.json"));
if (seed.Count == 0) return 0;
// FeatureMaintenances has a synthetic int Id assigned by the extractor (1-based ordinal).
// The original GlobalsImporter.ImportFeatureMaintenances added rows without dedup; since the
// seed is regenerated on every extract, clear-and-rewrite keeps re-runs idempotent and
// matches "the latest seed is authoritative". Pre-existing rows with seed-absent ids are
// dropped here (acceptable: only synthetic ordinals, no FKs reference this table).
// FeatureMaintenances use a synthetic ordinal id from the extractor; we clear-and-rewrite to
// keep re-runs idempotent and match "the latest seed is authoritative". Pre-existing rows
// with seed-absent ids are dropped here (acceptable: only synthetic ordinals, no FKs
// reference this table).
var existing = await context.FeatureMaintenances.ToListAsync();
context.FeatureMaintenances.RemoveRange(existing);
int created = 0;

View File

@@ -9,7 +9,7 @@ namespace SVSim.Bootstrap.Importers;
/// Reads <see cref="RotationConfig"/> from the GameConfigs table (populated by
/// <see cref="RotationConfigImporter"/>) and flips <c>CardSet.IsInRotation</c> to match.
/// Must run after RotationConfigImporter and CardImporter — CardSets missing from the DB
/// can't be promoted (the original GlobalsImporter behavior; we log a warning instead of failing).
/// can't be promoted (we log a warning instead of failing — the rotation flag flip is non-fatal).
/// </summary>
public class RotationFlagUpdater
{

View File

@@ -43,7 +43,7 @@ public static class Program
await using var context = new SVSimDbContext(NullLogger<SVSimDbContext>.Instance, dbOptions);
// Bootstrap applies pending migrations first — migrations are now DDL-only, all data
// (reference tables, cards, card cosmetic rewards, prod-captured globals, game config)
// (reference tables, cards, card cosmetic rewards, per-table seed globals, game config)
// is loaded by importers below. This means a freshly migrated DB is structure-only;
// every importer is idempotent so re-running is safe.
Console.WriteLine("[Bootstrap] Applying pending migrations...");
@@ -75,10 +75,8 @@ public static class Program
if (!opts.SkipGlobals)
{
// Per-domain seed pipeline. The legacy GlobalsImporter that parsed prod-captured
// /load/index, /mypage/index, /deck/info wire payloads directly is gone — capture
// → seed transformation lives in data_dumps/extract/*; importers below just
// deserialise the per-table JSON files in SVSim.Bootstrap/Data/seeds/.
// Per-domain seed pipeline. Each importer reads a per-table JSON seed file under
// SVSim.Bootstrap/Data/seeds/ produced by an extractor in data_dumps/extract/.
//
// RotationConfigImporter writes the Rotation GameConfig section that RotationFlagUpdater
// reads; CardImporter ran earlier in the !SkipCards block so CardSets are populated.