feat: 新增 Job Worker 系統與 API 文檔全面更新

This commit is contained in:
Warren
2026-03-26 16:16:34 +08:00
parent 80399b1c12
commit 82955504f3
70 changed files with 3460 additions and 376 deletions

View File

@@ -0,0 +1,22 @@
-- ================================================================
-- Migration 005: Change duration_secs to FLOAT8
-- Version: 005
-- Date: 2026-03-26
-- Description: Change processor_results.duration_secs from INT to FLOAT8
-- to match Rust f64 type and preserve fractional seconds.
-- ================================================================
-- 5.1.1: Drop the existing generated column
ALTER TABLE processor_results DROP COLUMN IF EXISTS duration_secs;
-- 5.1.2: Re-add as double precision (float8) computed column
ALTER TABLE processor_results ADD COLUMN duration_secs DOUBLE PRECISION GENERATED ALWAYS AS (
CASE
WHEN completed_at IS NOT NULL AND started_at IS NOT NULL
THEN EXTRACT(EPOCH FROM (completed_at - started_at))
ELSE NULL
END
) STORED;
-- 5.1.3: Update comment
COMMENT ON COLUMN processor_results.duration_secs IS 'Computed duration in seconds (completed - started) as double precision';