diff --git a/htykc_models/migrations/2026-04-27-100000_add_clazz_completed_at/up.sql b/htykc_models/migrations/2026-04-27-100000_add_clazz_completed_at/up.sql index b3b59fd..6ccc9f2 100644 --- a/htykc_models/migrations/2026-04-27-100000_add_clazz_completed_at/up.sql +++ b/htykc_models/migrations/2026-04-27-100000_add_clazz_completed_at/up.sql @@ -1,7 +1,7 @@ -- 业务「已结课」:首次点名落库时间;清空出勤后回到 NULL。与 start_from/end_by 日历态互补。 ALTER TABLE clazz - ADD COLUMN completed_at TIMESTAMP NULL; + ADD COLUMN IF NOT EXISTS completed_at TIMESTAMP NULL; COMMENT ON COLUMN clazz.completed_at IS '首次批量保存出勤且存在有效行时写入;出勤被清空则置 NULL。NULL 表示业务上未结课。';