hyubot

Tables (12)

DiaryChunk (다이어리 청크)

  • id (PK) — long — Primary key — NOT NULL
  • diary_id (다이어리FK) — long — Foreign key → diary.id — NOT NULL
  • diary_chunk_embedding_id (청크임베딩FK) — long — Foreign key → DiaryChunkEmbedding.id — NOT NULL
  • key_id (키FK) — long — Foreign key → keys.id — NOT NULL
  • chunk_index (몇 번째 청크) — int
  • content (내용) — string
  • token_count (토큰수) — int
  • created_at (생성날짜) — datetime

DiaryChunkEmbedding (다이어리 청크 임베딩용)

  • id (PK) — long — Primary key — NOT NULL
  • embedding (청크) — float

Users (유저)

  • id (PK) — Long — Primary key — NOT NULL
  • bot_id (봇FK) — long — Foreign key → bot.id — NOT NULL
  • key_id (키FK) — long — Foreign key → keys.id — NOT NULL
  • email (이메일) — string
  • nickname (닉네임) — string
  • is_sns (SNS계졍여부) — boolean
  • created_at (가입날짜) — datetime
  • updated_at (수정날짜) — datetime
  • deleted_at (삭제날짜) — datetime

bot (봇 정보)

  • id (PK) — long — Primary key — NOT NULL
  • name (이름) — string
  • persona (성격 정의) — string
  • script (스크립트) — string
  • is_active (활성화여부) — string
  • created_at (생성날짜) — datetime
  • updated_at (업데이트날짜) — datetime

bot_image (봇 이미지)

  • id (PK) — long — Primary key — NOT NULL
  • bot_id (봇FK) — long — Foreign key → bot.id — NOT NULL
  • mood (기분) — string
  • url (이미지 url) — string

chat_message (채팅 메시지)

  • id (PK) — long — Primary key — NOT NULL
  • chat_session_id (채팅 세션 FK) — long — Foreign key → chat_session.id — NOT NULL
  • key_id (키FK) — long — Foreign key → keys.id — NOT NULL
  • seq (채팅 순서) — int
  • role (보낸이(유저, 봇)) — enum
  • content (채팅내용) — string
  • created_at (생성날짜) — datetime

chat_session (채팅 세션)

  • id (PK) — long — Primary key — NOT NULL
  • diary_id (일기FK) — long — Foreign key → diary.id — NOT NULL
  • bot_id (봇FK) — long — Foreign key → bot.id — NOT NULL
  • status (현재 상태) — enum
  • send_count (전송 횟수) — int
  • summary (채팅 요약) — string
  • started_at (채팅시작날짜) — datetime
  • completed_at (채팅완료날짜) — datetime

diary (일기)

  • id (PK) — long — Primary key — NOT NULL
  • user_id (유저FK) — Long — Foreign key → Users.id — NOT NULL
  • key_id (키FK) — long — Foreign key → keys.id — NOT NULL
  • content (일기 내용) — string
  • emotion (감정) — enum
  • summary (프롬프트용 일기 요약) — string
  • date (일기 날짜) — date
  • created_at (생성날짜) — datetime
  • updated_at (업데이트날짜) — datetime
  • deleted_at (삭제 날짜) — datetime

email_verification (이메일 인증)

  • id (PK) — long — Primary key — NOT NULL
  • email (이메일) — string
  • code (인증 코드) — string
  • send_at (전송시간) — datetime
  • expired_at (만료시간) — datetime
  • sent_count (전송 횟수) — int

keys (암호화 키)

  • id (PK) — long — Primary key — NOT NULL
  • alg (알고리즘) — string
  • valid_from (유효시간시작) — timestamp
  • valid_to (유효시간 끝) — timestamp
  • key_material (key로암호화된dek) — byte[]
  • status (ㅇ태) — enum
  • created_at (생성시간) — timestamp

login_token (로그인 토큰)

  • id (PK) — long — Primary key — NOT NULL
  • user_id (FK) — Long — Foreign key → Users.id — NOT NULL
  • id (PK2) — long — Foreign key → Users.key_id — NOT NULL
  • type (토큰타입) — enum
  • issued_at (생성날짜) — datetime
  • expired_dat (만료날짜) — datetime
  • revoked_at (무효날짜) — datetime
  • user_agent (클라이언트 접속 기기) — string
  • ip_address (클라이언트 Ip) — string

sns_users (SNS계정)

  • id (PK) — Long — Primary key — NOT NULL
  • users_id (유저FK) — Long — Foreign key → Users.id — NOT NULL
  • id (PK2) — long — Foreign key → Users.bot_id — NOT NULL
  • id (PK22) — long — Foreign key → Users.key_id — NOT NULL
  • provider (SNS 종류) — enum
  • provider_uid (SNS uid) — string
  • created_at (생성날짜) — datetime