新增大厅订单容量控制

This commit is contained in:
yml2213
2026-08-21 14:02:30 +08:00
parent cc03382921
commit 874b093a4b
20 changed files with 407 additions and 44 deletions
@@ -0,0 +1,14 @@
-- 051_worker_hall_queue.sql —— 抢单大厅展示队列与容量查询索引。
ALTER TABLE work_orders ADD COLUMN IF NOT EXISTS hall_queued_at TIMESTAMPTZ NULL;
UPDATE work_orders
SET hall_queued_at = COALESCE(published_at, updated_at, created_at)
WHERE status = 'open'
AND hall_queued_at IS NULL;
CREATE INDEX IF NOT EXISTS idx_work_orders_hall_queue
ON work_orders(hall_queued_at ASC, id ASC)
WHERE status = 'open';
COMMENT ON COLUMN work_orders.hall_queued_at IS '进入抢单大厅候选队列的时间;用于按先进先出限制大厅展示数量';