2026 UNITHON
Tables (21)
access_logs
- log_id — BIGINT — Primary key — NOT NULL — 로그 ID
- store_id — BIGINT — Foreign key → stores.store_id — NOT NULL — 매장 ID
- user_id — BIGINT — Foreign key → users.user_id — NOT NULL — 사용자 ID
- card_id — BIGINT — Foreign key → knowledge_cards.card_id — 조회한 지식카드 ID
- action_type — VARCHAR(30) — NOT NULL — VIEW/QUERY/EXPORT
- accessed_at — DATETIME — NOT NULL — 접근일시
card_embeddings
- embedding_id — BIGINT — Primary key — NOT NULL — 임베딩 ID
- card_id — BIGINT — Foreign key — NOT NULL — 지식카드 ID
- store_id — BIGINT — Foreign key — NOT NULL — 매장 ID(행 단위 격리)
- chunk_index — INT — NOT NULL — 청크 순번
- chunk_text — TEXT — NOT NULL — 임베딩 대상 원문(BM25 병용)
- embedding — VECTOR(1536) — NOT NULL — pgvector 임베딩
- model_name — VARCHAR(50) — NOT NULL — 임베딩 모델명
- content_hash — VARCHAR(64) — NOT NULL — 원문 해시(재색인 판단용)
- indexed_at — DATETIME — NOT NULL — 색인일시
chat_messages
- message_id — BIGINT — Primary key — NOT NULL — 메시지 ID
- session_id — BIGINT — Foreign key → chat_sessions.session_id — NOT NULL — 세션 ID
- sender_type — VARCHAR(10) — NOT NULL — USER / BUDDY
- content — TEXT — NOT NULL — 메시지 내용
- answer_type — VARCHAR(20) — ANSWERED/ABSTAINED/ESCALATED
- confidence — DECIMAL(5, 2) — 답변 신뢰도(%)
- created_at — DATETIME — NOT NULL — 전송일시
chat_sessions
- session_id — BIGINT — Primary key — NOT NULL — 세션 ID
- store_id — BIGINT — Foreign key → stores.store_id — NOT NULL — 매장 ID
- member_id — BIGINT — Foreign key → store_members.member_id — NOT NULL — 구성원 ID
- started_at — DATETIME — NOT NULL — 시작일시
facts
- fact_id — BIGINT — Primary key — NOT NULL — 사실 ID
- card_id — BIGINT — Foreign key → knowledge_cards.card_id — NOT NULL — 지식카드 ID
- object_name — VARCHAR(100) — NOT NULL — 대상(우유, 시럽 등)
- attribute — VARCHAR(100) — NOT NULL — 속성(보관위치, 발주기준 등)
- value — VARCHAR(500) — NOT NULL — 값(냉장고 2단 왼쪽 칸)
- confidence — DECIMAL(5, 2) — NOT NULL — 신뢰도(%)
- is_verified — TINYINT(1) — NOT NULL — 검증 여부
invite_codes
- invite_id — BIGINT — Primary key — NOT NULL — 초대코드 ID
- store_id — BIGINT — Foreign key → stores.store_id — NOT NULL — 매장 ID
- code — VARCHAR(30) — NOT NULL — 초대 코드(CAFE-2024-XK9)
- is_used — TINYINT(1) — NOT NULL — 사용 여부
- used_by — BIGINT — Foreign key → users.user_id — 사용한 user_id
- expires_at — DATETIME — NOT NULL — 만료일시
- created_at — DATETIME — NOT NULL — 생성일시
knowledge_cards
- card_id — BIGINT — Primary key — NOT NULL — 지식카드 ID
- store_id — BIGINT — Foreign key → stores.store_id — NOT NULL — 매장 ID
- category_id — BIGINT — Foreign key → task_categories.category_id — 업무 카테고리 ID
- source_id — BIGINT — Foreign key → sources.source_id — 출처 자료 ID
- title — VARCHAR(200) — NOT NULL — 카드 제목
- content — TEXT — NOT NULL — 카드 본문
- confidence — DECIMAL(5, 2) — NOT NULL — 신뢰도(%)
- is_verified — TINYINT(1) — NOT NULL — 사장님 검증 여부
- is_sensitive — TINYINT(1) — NOT NULL — 레시피 등 민감 정보
- created_at — DATETIME — NOT NULL — 생성일시
knowledge_gaps
- gap_id — BIGINT — Primary key — NOT NULL — 빈지식 ID
- store_id — BIGINT — Foreign key → stores.store_id — NOT NULL — 매장 ID
- category_id — BIGINT — Foreign key → task_categories.category_id — 업무 카테고리 ID
- gap_title — VARCHAR(200) — NOT NULL — 발주 처리 방법 / POS 오류 대처법 등
- detected_by — VARCHAR(20) — NOT NULL — AI / QUESTION
- is_resolved — TINYINT(1) — NOT NULL — 해결 여부
- created_at — DATETIME — NOT NULL — 감지일시
learning_progress
- progress_id — BIGINT — Primary key — NOT NULL — 진행도 ID
- member_id — BIGINT — Foreign key → store_members.member_id — NOT NULL — 구성원 ID
- item_id — BIGINT — Foreign key → roadmap_items.item_id — NOT NULL — 체크리스트 ID
- status — VARCHAR(20) — NOT NULL — LOCKED/IN_PROGRESS/DONE
- completed_at — DATETIME — 완료일시
message_citations
- citation_id — BIGINT — Primary key — NOT NULL — 근거 ID
- message_id — BIGINT — Foreign key → chat_messages.message_id — NOT NULL — 메시지 ID
- card_id — BIGINT — Foreign key → knowledge_cards.card_id — NOT NULL — 지식카드 ID
- relevance — DECIMAL(5, 2) — NOT NULL — 유사도 점수
owner_answers
- answer_id — BIGINT — Primary key — NOT NULL — 답변 ID
- question_id — BIGINT — Foreign key → pending_questions.question_id — NOT NULL — 질문 ID
- answered_by — BIGINT — Foreign key → users.user_id — NOT NULL — 답변자 user_id
- answer_text — TEXT — NOT NULL — 답변 내용
- card_id — BIGINT — Foreign key → knowledge_cards.card_id — 지식화된 카드 ID
- answered_at — DATETIME — NOT NULL — 답변일시
pending_questions
- question_id — BIGINT — Primary key — NOT NULL — 질문 ID
- store_id — BIGINT — Foreign key → stores.store_id — NOT NULL — 매장 ID
- member_id — BIGINT — Foreign key → store_members.member_id — NOT NULL — 질문한 구성원 ID
- message_id — BIGINT — Foreign key → chat_messages.message_id — 원본 메시지 ID
- question_text — VARCHAR(500) — NOT NULL — 질문 내용
- status — VARCHAR(20) — NOT NULL — WAITING/ANSWERED
- created_at — DATETIME — NOT NULL — 질문일시
roadmap_items
- item_id — BIGINT — Primary key — NOT NULL — 체크리스트 ID
- stage_id — BIGINT — Foreign key → roadmap_stages.stage_id — NOT NULL — 단계 ID
- card_id — BIGINT — Foreign key → knowledge_cards.card_id — 연결 지식카드 ID
- item_name — VARCHAR(200) — NOT NULL — 항목명(매장 전체 둘러보기 등)
- item_order — INT — NOT NULL — 항목 순서
roadmap_stages
- stage_id — BIGINT — Primary key — NOT NULL — 단계 ID
- store_id — BIGINT — Foreign key → stores.store_id — NOT NULL — 매장 ID
- stage_name — VARCHAR(100) — NOT NULL — 가게투어/식자재위치/레시피숙지/오픈업무/마감업무
- stage_order — INT — NOT NULL — 단계 순서(1~5)
source_frames
- frame_id — BIGINT — Primary key — NOT NULL — 프레임 ID
- source_id — BIGINT — Foreign key → sources.source_id — NOT NULL — 자료 ID
- frame_index — INT — NOT NULL — 프레임 순번
- timestamp_sec — INT — NOT NULL — 영상 내 시점(초)
- image_url — VARCHAR(500) — NOT NULL — 프레임 이미지 경로
- caption — TEXT — AI 생성 장면 설명
sources
- source_id — BIGINT — Primary key — NOT NULL — 자료 ID
- store_id — BIGINT — Foreign key → stores.store_id — NOT NULL — 매장 ID
- uploaded_by — BIGINT — Foreign key → users.user_id — NOT NULL — 업로더 user_id
- source_type — VARCHAR(20) — NOT NULL — VOICE/VIDEO/KAKAO/FILE_SCAN
- file_url — VARCHAR(500) — 저장 경로
- duration_sec — INT — 음성·영상 길이(초)
- transcript — TEXT — STT/OCR 결과 원문
- status — VARCHAR(20) — NOT NULL — UPLOADED/PROCESSING/DONE/FAILED
- created_at — DATETIME — NOT NULL — 업로드일시
store_members
- member_id — BIGINT — Primary key — NOT NULL — 구성원 ID
- store_id — BIGINT — Foreign key → stores.store_id — NOT NULL — 매장 ID
- user_id — BIGINT — Foreign key → users.user_id — NOT NULL — 사용자 ID
- member_role — VARCHAR(20) — NOT NULL — OWNER / STAFF
- joined_at — DATETIME — NOT NULL — 합류일시
- day_count — INT — NOT NULL — 근무 일차
stores
- store_id — BIGINT — Primary key — NOT NULL — 매장 ID
- owner_id — BIGINT — Foreign key → users.user_id — NOT NULL — 사장님 user_id
- store_name — VARCHAR(100) — NOT NULL — 매장명
- business_type — VARCHAR(20) — NOT NULL — 업종(CAFE/RESTAURANT/BAKERY/BAR/CVS/SALON)
- dek_encrypted — VARBINARY(512) — 매장별 암호화 키(Envelope)
- created_at — DATETIME — NOT NULL — 생성일시
task_categories
- category_id — BIGINT — Primary key — NOT NULL — 카테고리 ID
- store_id — BIGINT — Foreign key → stores.store_id — NOT NULL — 매장 ID
- category_name — VARCHAR(50) — NOT NULL — 오픈업무/재고정리/음료제작/마감업무/베이킹
- is_enabled — TINYINT(1) — NOT NULL — 사용 여부(토글)
- sort_order — INT — NOT NULL — 정렬 순서
understanding_scores
- score_id — BIGINT — Primary key — NOT NULL — 이해도 ID
- member_id — BIGINT — Foreign key → store_members.member_id — NOT NULL — 구성원 ID
- score — DECIMAL(5, 2) — NOT NULL — 이해도(%)
- coverage — DECIMAL(5, 2) — NOT NULL — 지식 커버리지(%)
- is_deployable — TINYINT(1) — NOT NULL — 투입 가능 여부
- measured_at — DATETIME — NOT NULL — 측정일시
users
- user_id — BIGINT — Primary key — NOT NULL — 사용자 ID
- name — VARCHAR(50) — NOT NULL — 이름
- phone — VARCHAR(20) — 연락처
- role — VARCHAR(20) — NOT NULL — OWNER / STAFF
- created_at — DATETIME — NOT NULL — 가입일시