Files
digital-psychology/apps/api/migrations/000023_home_daily_tips.up.sql
T
jackyu66gitandCursor 89756f65b4 feat(ECR-012–016): 合规、题库、时辰刷新、头像、MBTI OEJTS 与埋点
落地输入合规、探索题库、报告日/时辰刷新、账号头像、OEJTS 量表,并补齐 H5 埋点与 Admin 漏斗;同步 ESS 工件、切至自建 Git、清理 GitHub Actions。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-13 01:27:58 +08:00

15 lines
580 B
SQL
Raw 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.
-- Persist homepage tips per user × 时辰 (ECR-adjacent · home R7)
CREATE TABLE IF NOT EXISTS home_daily_tips (
id uuid PRIMARY KEY DEFAULT gen_random_uuid(),
user_id uuid NOT NULL REFERENCES users(id),
shichen_start timestamptz NOT NULL,
shichen smallint NOT NULL CHECK (shichen BETWEEN 0 AND 11),
tips jsonb NOT NULL,
source varchar(16) NOT NULL DEFAULT 'fallback',
created_at timestamptz NOT NULL DEFAULT now(),
UNIQUE (user_id, shichen_start)
);
CREATE INDEX IF NOT EXISTS idx_home_daily_tips_user_start
ON home_daily_tips (user_id, shichen_start DESC);