Files
streamline/drizzle/0049_batch_settled.sql
2026-11-16 17:26:44 -08:00

10 lines
752 B
SQL
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
-- 批次「完成结算」(control-server/src/batch_center.ts::settleBatch)。
--
-- 负责人或管理员在结算期(进度 ≥ 90%)点「完成结算」,标志这一批进入生命周期末期。它几乎
-- 不改变什么:没修完的单照样能在抽屉里操作,进度和效率照常重算;只是记下谁、什么时候结算的,
-- 以及结算那一刻的数字(settled_snapshot,JSON,见 shared BatchSettleSnapshot),让面板能写
-- 「结算时 92% → 现在 95%」。可以撤回(三列清空)。
ALTER TABLE "batches" ADD COLUMN IF NOT EXISTS "settled_at" bigint;
ALTER TABLE "batches" ADD COLUMN IF NOT EXISTS "settled_by" text;
ALTER TABLE "batches" ADD COLUMN IF NOT EXISTS "settled_snapshot" text;