- Update D-216 amendment text to match the implemented decision: events-first uses event_type='colonial_charter' (9 systems, 11 bodies, 5 diverging from wave) — not the stale founding/first_settlement/ colonization scaffolding vocabulary. - Add ORDER BY sort_order ASC to the colonial_charter subquery for a deterministic pick if a system ever has two charter rows. - Add explicit ELSE NULL to the wave-fallback CASE so an unexpected settlement_wave leaves a trace instead of silently nulling. Data unchanged: 269/273 set, 4 Sol NULL; stamp fresh. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -380,6 +380,7 @@ SET founding_age_years = COALESCE(
|
||||
FROM historical_events he
|
||||
WHERE he.system_id = bodies.system_id
|
||||
AND he.event_type = 'colonial_charter'
|
||||
ORDER BY he.sort_order ASC
|
||||
LIMIT 1
|
||||
),
|
||||
(
|
||||
@@ -389,6 +390,7 @@ SET founding_age_years = COALESCE(
|
||||
WHEN 'wave_3' THEN 300
|
||||
WHEN 'wave_4' THEN 100
|
||||
WHEN 'wave_5' THEN 40
|
||||
ELSE NULL -- unexpected settlement_wave: add a WHEN above
|
||||
END
|
||||
FROM system_history sh
|
||||
WHERE sh.system_id = bodies.system_id
|
||||
|
||||
Reference in New Issue
Block a user