-- agent_invocations.cost_cents (Int 分) → cost_yuan (Decimal 元 6 位小数)
-- 原因:单次 LLM 调用成本常 <0.01 分(如 ¥0.0034),Int 分粒度全归零,仪表盘看不出差异。

ALTER TABLE "agent_invocations"
  ADD COLUMN "cost_yuan" NUMERIC(12, 6) NOT NULL DEFAULT 0;

-- 历史数据搬迁:cost_cents (Int 分) → cost_yuan (¥) = cost_cents / 100
UPDATE "agent_invocations" SET "cost_yuan" = "cost_cents"::numeric / 100;

ALTER TABLE "agent_invocations" DROP COLUMN "cost_cents";
