feat(inventory-go): store od_rating at ingest + schema column

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
Erik 2026-07-15 08:03:57 +02:00
parent 9b2f28d942
commit e07a9459cd
2 changed files with 5 additions and 0 deletions

View file

@ -136,6 +136,10 @@ func (s *Server) processItem(raw map[string]any) map[string]any {
"remaining_lifespan": nilNeg(ivI(iv, "268", -1)),
}
if od, ok := computeOD(raw); ok {
items["od_rating"] = od
}
// combat (sentinel defaults), then base values merged.
wt := ivI(iv, "218103835", -1)
if wt > 100 {

View file

@ -38,6 +38,7 @@ func initSchema(ctx context.Context, pool *pgxpool.Pool, log *slog.Logger) {
rare_id INTEGER,
lifespan INTEGER,
remaining_lifespan INTEGER,
od_rating DOUBLE PRECISION,
has_id_data BOOLEAN DEFAULT false,
last_id_time BIGINT DEFAULT 0,
CONSTRAINT uq_char_item UNIQUE (character_name, item_id)