Annie
테이블 (10)
[메타데이터] 결제플랜 (plan)
- id — bigint — 기본 키 — NOT NULL
- date (name) — string — NOT NULL — 결제플랜명 (free / starter / pro)
- Field (monthly_allowance) — int — NOT NULL — 가능 통화량 (초단위)
[메타데이터] 일기 태그 (diary_tag)
- id — bigint — 기본 키 — NOT NULL
- date (name) — string — NOT NULL — 태그 이름
user_plan_usage
- id — bigint — 기본 키 — NOT NULL
- id (user_id) — bigint — 외래 키 → 사용자.id — NOT NULL
- id (plan_id) — bigint — 외래 키 → 사용자.id — NOT NULL
- Field (monthly_allowance) — int — 월별 가능 통화시간 (초단위)
- Field (used) — int — NOT NULL — 월별 사용자가 통화한 시간 (초단위)
- Field (sub_start_at) — datetime — 구독기간 시작일
- Field (sub_end_at) — datetime — 구독기간 종료일
- Field (created_at) — datetime — NOT NULL — UTC 생성 일시 (YYYY-MM-DD HH:mm:ss)
- Field (updated_at) — datetime — NOT NULL — UTC 수정 일시 (YYYY-MM-DD HH:mm:ss)
사용자 (user)
- id — bigint — 기본 키 — NOT NULL
- id (plan_id) — bigint — 외래 키 → [메타데이터] 결제플랜.id — NOT NULL
- nickname — string — NOT NULL — 닉네임
- phone — string — NOT NULL — 전화번호
- email — string — NOT NULL — 이메일
- Field (next_renewal_date) — date — 다음 결제 갱신일
- Field (language) — string — NOT NULL — 선호 언어
- Field (created_at) — datetime — NOT NULL — UTC 생성 일시 (YYYY-MM-DD HH:mm:ss)
- Field (updated_at) — datetime — NOT NULL — UTC 수정 일시 (YYYY-MM-DD HH:mm:ss)
- Field (deleted_at) — datetime — UTC 삭제 일시 (YYYY-MM-DD HH:mm:ss)
연속일기 달성일 (user_streak)
- id — int — 기본 키 — NOT NULL
- id (user_id) — bigint — 외래 키 → 사용자.id — NOT NULL
- last_entry_date (streak_days) — int — NOT NULL — 연속일 달성 수
- current_streak (start_date) — date — 연속일 시작일
- longest_streak (end_date) — date — 연속일 종료일
- Field (updated_at) — datetime — NOT NULL — UTC 수정 일시 (YYYY-MM-DD HH:mm:ss)
- Field (deleted_at) — datetime — UTC 삭제 일시 (YYYY-MM-DD HH:mm:ss)
월별 통계 (montly_stats)
- id — bigint — 기본 키 — NOT NULL
- id (user_id) — bigint — 외래 키 → 사용자.id — NOT NULL
- nickname (year) — int — NOT NULL — 연도
- phone (month) — int — NOT NULL — 월
- email (total_entries) — bigint — NOT NULL — 일기 수
- Field (mood_distribution) — JSONB — 감정 통계 {"happy": 5, "peaceful": 10, ...}
- Field (popular_tags) — JSONB — 인기 태그 [{"tag": "#work", "count": 12}, ...]
- Field (created_at) — datetime — NOT NULL — UTC 생성 일시 (YYYY-MM-DD HH:mm:ss)
일기 (user_diary)
- id — bigint — 기본 키 — NOT NULL
- user_id — bigint — 외래 키 → 사용자.id — NOT NULL
- date — datetime — NOT NULL — 일기 날짜 (UTC)
- title — string — NOT NULL — 제목 (30자 이하)
- original_context (content) — string — NOT NULL — 일기 내용 (1000자 이하)
- Field (mood) — string — 감정 (energetic / happy / peaceful / bad / anxious / terrible / upset)
- created_at — datetime — NOT NULL — UTC 생성 일시 (YYYY-MM-DD HH:mm:ss)
- updated_at — datetime — NOT NULL — UTC 수정 일시 (YYYY-MM-DD HH:mm:ss)
- Field (deleted_at) — datetime — UTC 삭제 일시 (YYYY-MM-DD HH:mm:ss)
일기 별 태그 (user_diary_tag)
- id — bigint — 기본 키 — NOT NULL
- id (user_diary_id) — bigint — 외래 키 → 일기.id — NOT NULL
- id (diary_tag_id) — bigint — 외래 키 → [메타데이터] 일기 태그.id — NOT NULL
통화 스케줄 (call_schedule)
- id — bigint — 기본 키 — NOT NULL
- id (user_id) — bigint — 외래 키 → 사용자.id — NOT NULL
- Field (time) — time — NOT NULL — 통화 시간
- Field2 (days_of_week) — int[] — NOT NULL — '{1,2,3,4,5,6,7}', -- 1=월요일, 7=일요일
- Field3 (enabled) — boolean — NOT NULL — 활성 여부
- Field (created_at) — datetime — NOT NULL — UTC 생성 일시 (YYYY-MM-DD HH:mm:ss)
- Field (updated_at) — datetime — NOT NULL — UTC 수정 일시 (YYYY-MM-DD HH:mm:ss)
- Field (deleted_at) — datetime — UTC 삭제 일시 (YYYY-MM-DD HH:mm:ss)
통화 히스토리 (call_history)
- id — bigint — 기본 키 — NOT NULL
- id (call_schedule_id) — bigint — 외래 키 → 통화 스케줄.id — NOT NULL
- id (user_id) — bigint — 외래 키 → 사용자.id — NOT NULL
- Field (taken_minute) — int — NOT NULL — 통화 소요시간 (분단위)
- Field (created_at) — datetime — NOT NULL — UTC 생성 일시 (YYYY-MM-DD HH:mm:ss)
- Field (updated_at) — datetime — NOT NULL — UTC 수정 일시 (YYYY-MM-DD HH:mm:ss)