writer

Tables (20)

audit_logs (감사 로그)

  • id — bigint
  • writer_id — bigint — Foreign key → writers.id
  • action — varchar(100) — NOT NULL
  • ip_address — varchar(50)
  • user_agent — varchar(500)
  • created_at — timestamp

character_fields (인물 커스텀 필드)

  • id — bigint
  • setting_id — bigint — Foreign key → settings.id — NOT NULL
  • field_name — varchar(100) — NOT NULL
  • field_value — text
  • sort_order — int — NOT NULL
  • created_at — timestamp

custom_dictionaries (맞춤법 사전)

  • id — bigint
  • writer_id — bigint — Foreign key → writers.id — NOT NULL
  • work_id — bigint — Foreign key → works.id — NOT NULL
  • setting_id — bigint — Foreign key → settings.id
  • word — varchar(200) — NOT NULL
  • type — varchar(20) — NOT NULL
  • created_at — timestamp

episode_versions (버전 히스토리)

  • id — bigint
  • episode_id — bigint — Foreign key → episodes.id — NOT NULL
  • content_diff — text
  • word_count — int — NOT NULL
  • saved_at — timestamp — NOT NULL

episodes (회차 원고)

  • id — bigint
  • work_id — bigint — Foreign key → works.id — NOT NULL
  • writer_id — bigint — Foreign key → writers.id — NOT NULL
  • episode_number — int — NOT NULL
  • title — varchar(200)
  • content_encrypted — text
  • word_count — int — NOT NULL
  • version — bigint — NOT NULL
  • created_at — timestamp
  • updated_at — timestamp

export_jobs (내보내기 작업)

  • id — bigint
  • writer_id — bigint — Foreign key → writers.id — NOT NULL
  • status — varchar(20) — NOT NULL
  • file_url — varchar(500)
  • expires_at — timestamp
  • created_at — timestamp

foreshadow_appearances (떡밥 등장 위치)

  • id — bigint
  • foreshadow_id — bigint — Foreign key → foreshadows.id — NOT NULL
  • episode_number — int — NOT NULL
  • page_number — int
  • context_memo — text
  • created_at — timestamp

foreshadows (떡밥)

  • id — bigint
  • work_id — bigint — Foreign key → works.id — NOT NULL
  • writer_id — bigint — Foreign key → writers.id — NOT NULL
  • title — varchar(200) — NOT NULL
  • content — text
  • status — varchar(20) — NOT NULL
  • last_appeared_ep — int
  • created_at — timestamp
  • updated_at — timestamp

orders (결제 주문)

  • id — bigint
  • writer_id — bigint — Foreign key → writers.id — NOT NULL
  • order_id — varchar(100) — NOT NULL
  • payment_key — varchar(200)
  • amount — int — NOT NULL
  • token_qty — int — NOT NULL
  • status — varchar(20) — NOT NULL
  • created_at — timestamp
  • updated_at — timestamp

relations

  • id — bigint
  • work_id — bigint — Foreign key → works.id — NOT NULL
  • writer_id — bigint — Foreign key → writers.id — NOT NULL
  • from_setting_id — bigint — Foreign key → settings.id — NOT NULL
  • to_setting_id — bigint — Foreign key → settings.id — NOT NULL
  • relation_type — varchar(100) — NOT NULL
  • description — text
  • created_at — timestamp
  • updated_at — timestamp

review_results (AI 검수 결과)

  • id — bigint
  • writer_id — bigint — Foreign key → writers.id — NOT NULL
  • work_id — bigint — Foreign key → works.id — NOT NULL
  • episode_id — bigint — Foreign key → episodes.id — NOT NULL
  • setting_conflicts — text
  • tone_conflicts — text
  • new_items — text
  • tokens_used — int — NOT NULL
  • created_at — timestamp

sentence_archives (문장 아카이빙 그룹)

  • id — bigint
  • work_id — bigint — Foreign key → works.id — NOT NULL
  • writer_id — bigint — Foreign key → writers.id — NOT NULL
  • episode_id — bigint — Foreign key → episodes.id
  • sentence — text — NOT NULL
  • memo — text
  • source_type — varchar(20) — NOT NULL
  • created_at — timestamp

sentence_tags (문장 태그)

  • id — bigint
  • archive_id — bigint — Foreign key → sentence_archives.id — NOT NULL
  • tag — varchar(100) — NOT NULL

settings (설정집)

  • id — bigint
  • work_id — bigint — Foreign key → works.id — NOT NULL
  • writer_id — bigint — Foreign key → writers.id — NOT NULL
  • category — varchar(20) — NOT NULL
  • name — varchar(200) — NOT NULL
  • description — text
  • attributes — text
  • embedding — text
  • in_dictionary — boolean — NOT NULL
  • created_at — timestamp
  • updated_at — timestamp

subscriptions (구독)

  • id — bigint
  • writer_id — bigint — Foreign key → writers.id — NOT NULL
  • billing_key — varchar(200) — NOT NULL
  • plan — varchar(50) — NOT NULL
  • monthly_tokens — int — NOT NULL
  • status — varchar(20) — NOT NULL
  • next_billing_at — timestamp — NOT NULL
  • cancelled_at — timestamp
  • created_at — timestamp

token_histories (토큰 이력)

  • id — bigint
  • writer_id — bigint — Foreign key → writers.id — NOT NULL
  • amount — int — NOT NULL
  • type — varchar(20) — NOT NULL
  • reason — varchar(100)
  • reference_id — bigint
  • created_at — timestamp

tokens (토큰)

  • id — bigint
  • writer_id — bigint — Foreign key → writers.id — NOT NULL
  • refresh_token — varchar(500) — NOT NULL
  • expires_at — timestamp — NOT NULL
  • created_at — timestamp

works (작품)

  • id — bigint
  • writer_id — bigint — Foreign key → writers.id — NOT NULL
  • title — varchar(200) — NOT NULL
  • genre — varchar(50)
  • status — varchar(20) — NOT NULL
  • created_at — timestamp
  • updated_at — timestamp

writer_tokens (토큰 잔량)

  • writer_id — bigint — Foreign key → writers.id
  • balance — int — NOT NULL
  • total_charged — int — NOT NULL
  • total_used — int — NOT NULL
  • updated_at — timestamp

writers (작가 계정)

  • id — bigint
  • email — varchar(255) — NOT NULL
  • password_hash — varchar(255)
  • oauth_provider — varchar(50)
  • oauth_id — varchar(255)
  • created_at — timestamp
  • deleted_at — timestamp