Subees ERD

Tables (19)

analysis_reports

  • report_id — BIGINT — Primary key — NOT NULL
  • user_id — BIGINT — Foreign key → users.user_id — NOT NULL
  • report_type — ENUM( 'CONSUME_MONTHLY_TREND', 'CONSUME_CATEGORY_SHARE', 'IMPROVEMENT_SUGGESTION', 'BUDGET_RECOMMENDATION' ) — NOT NULL
  • target_month — CHAR(7)
  • content_json — JSON — NOT NULL
  • created_at — DATETIME — NOT NULL

audit_logs

  • log_id — BIGINT — Primary key — NOT NULL
  • actor_user_id — BIGINT — Foreign key → users.user_id
  • target_user_id — BIGINT — Foreign key → users.user_id
  • action_type — VARCHAR(64) — NOT NULL
  • action_detail — JSON
  • created_at — DATETIME — NOT NULL

community_post_scraps

  • scrap_id — BIGINT — Primary key — NOT NULL
  • post_id — BIGINT — Foreign key → community_posts.post_id — NOT NULL
  • user_id — BIGINT — Foreign key → users.user_id — NOT NULL
  • created_at — DATETIME — NOT NULL

community_posts

  • post_id — BIGINT — Primary key — NOT NULL
  • author_user_id — BIGINT — Foreign key → users.user_id — NOT NULL
  • title — VARCHAR(200) — NOT NULL
  • content — LONGTEXT — NOT NULL
  • view_count — BIGINT — NOT NULL
  • scrap_count — BIGINT — NOT NULL
  • share_token — CHAR(36)
  • deleted_at — DATETIME
  • created_at — DATETIME — NOT NULL
  • updated_at — DATETIME — NOT NULL

global_subscription_stats_monthly

  • stat_month — CHAR(7) — Primary key — NOT NULL
  • service_id — BIGINT — Foreign key → subscription_services.service_id — NOT NULL
  • avg_amount — INT — NOT NULL
  • user_count — INT — NOT NULL
  • updated_at — DATETIME — NOT NULL

notification_events

  • notification_id — BIGINT — Primary key — NOT NULL
  • user_id — BIGINT — Foreign key → users.user_id — NOT NULL
  • user_subscription_id — BIGINT — Foreign key → user_subscriptions.user_subscription_id — NOT NULL
  • event_type — ENUM('BILLING_D3','BILLING_D0') — NOT NULL
  • event_date — DATE — NOT NULL
  • show_start_time — TIME — NOT NULL
  • show_end_time — TIME — NOT NULL
  • dismissed_at — DATETIME
  • created_at — DATETIME — NOT NULL

recommendation_plan_items

  • plan_item_id — BIGINT — Primary key — NOT NULL
  • plan_id — BIGINT — Foreign key → recommendation_plans.plan_id — NOT NULL
  • service_id — BIGINT — Foreign key → subscription_services.service_id — NOT NULL
  • plan_id_ref — BIGINT — Foreign key → subscription_service_plans.plan_id
  • price — INT — NOT NULL

recommendation_plans

  • plan_id — BIGINT — Primary key — NOT NULL
  • run_id — BIGINT — Foreign key → recommendation_runs.run_id — NOT NULL
  • rank_no — INT — NOT NULL
  • total_price — INT — NOT NULL
  • summary — VARCHAR(255)
  • detail_json — JSON
  • is_saved — TINYINT(1) — NOT NULL
  • saved_image_url — VARCHAR(1024)
  • created_at — DATETIME — NOT NULL

recommendation_runs

  • run_id — BIGINT — Primary key — NOT NULL
  • user_id — BIGINT — Foreign key → users.user_id — NOT NULL
  • run_type — ENUM('BUDGET_COMBINATION','IMPROVEMENT_SUGGESTION') — NOT NULL
  • input_snapshot — JSON — NOT NULL
  • created_at — DATETIME — NOT NULL

subscription_categories

  • category_id — BIGINT — Primary key — NOT NULL
  • category_key — VARCHAR(30) — NOT NULL
  • display_name — VARCHAR(50) — NOT NULL
  • sort_order — INT — NOT NULL
  • is_active — TINYINT(1) — NOT NULL
  • created_at — DATETIME — NOT NULL
  • updated_at — DATETIME — NOT NULL

subscription_service_plans

  • plan_id — BIGINT — Primary key — NOT NULL
  • service_id — BIGINT — Foreign key → subscription_services.service_id — NOT NULL
  • plan_name — VARCHAR(80) — NOT NULL
  • monthly_price — INT
  • yearly_price — INT
  • summary — VARCHAR(255)
  • is_active — TINYINT(1) — NOT NULL
  • created_at — DATETIME — NOT NULL
  • updated_at — DATETIME — NOT NULL

subscription_services

  • service_id — BIGINT — Primary key — NOT NULL
  • category_id — BIGINT — Foreign key → subscription_categories.category_id — NOT NULL
  • service_name — VARCHAR(80) — NOT NULL
  • is_system_seed — TINYINT(1) — NOT NULL
  • created_by_user_id — BIGINT — Foreign key → users.user_id
  • is_active — TINYINT(1) — NOT NULL
  • created_at — DATETIME — NOT NULL
  • updated_at — DATETIME — NOT NULL

user_budget_preferences

  • pref_id — BIGINT — Primary key — NOT NULL
  • user_id — BIGINT — Foreign key → users.user_id — NOT NULL
  • pref_type — ENUM('REQUIRED','OPTIONAL') — NOT NULL
  • service_id — BIGINT — Foreign key → subscription_services.service_id — NOT NULL
  • is_selected — TINYINT(1) — NOT NULL
  • created_at — DATETIME — NOT NULL

user_budget_settings

  • user_id — BIGINT — Foreign key → users.user_id — NOT NULL
  • monthly_budget — INT — NOT NULL
  • updated_at — DATETIME — NOT NULL

user_payment_methods

  • payment_method_id — BIGINT — Primary key — NOT NULL
  • user_id — BIGINT — Foreign key → users.user_id — NOT NULL
  • method_type — ENUM('CARD','OTHER') — NOT NULL
  • display_name — VARCHAR(60) — NOT NULL
  • alias_name — VARCHAR(60)
  • last4 — CHAR(4)
  • memo — VARCHAR(255)
  • is_active — TINYINT(1) — NOT NULL
  • created_at — DATETIME — NOT NULL
  • updated_at — DATETIME — NOT NULL

user_subscription_status_history

  • history_id — BIGINT — Primary key — NOT NULL
  • user_subscription_id — BIGINT — Foreign key → user_subscriptions.user_subscription_id — NOT NULL
  • from_active_yn — CHAR(1)
  • to_active_yn — CHAR(1) — NOT NULL
  • changed_at — DATETIME — NOT NULL
  • changed_by_user_id — BIGINT — Foreign key → users.user_id

user_subscriptions

  • user_subscription_id — BIGINT — Primary key — NOT NULL
  • user_id — BIGINT — Foreign key → users.user_id — NOT NULL
  • category_id — BIGINT — Foreign key → subscription_categories.category_id — NOT NULL
  • service_id — BIGINT — Foreign key → subscription_services.service_id — NOT NULL
  • plan_id — BIGINT — Foreign key → subscription_service_plans.plan_id
  • plan_name_override — VARCHAR(80)
  • payment_method_id — BIGINT — Foreign key → user_payment_methods.payment_method_id
  • amount — INT — NOT NULL
  • billing_cycle — ENUM('MONTHLY','YEARLY') — NOT NULL
  • billing_date — DATE — NOT NULL
  • active_yn — CHAR(1) — NOT NULL
  • deleted_at — DATETIME
  • created_at — DATETIME — NOT NULL
  • updated_at — DATETIME — NOT NULL

user_verification_tokens

  • token_id — BIGINT — Primary key — NOT NULL
  • user_id — BIGINT — Foreign key → users.user_id — NOT NULL
  • token_type — ENUM('EMAIL_VERIFY','PW_RESET') — NOT NULL
  • token_code — VARCHAR(64) — NOT NULL
  • expires_at — DATETIME — NOT NULL
  • consumed_at — DATETIME
  • created_at — DATETIME — NOT NULL

users

  • user_id — BIGINT — Primary key — NOT NULL
  • email — VARCHAR(255) — NOT NULL
  • password_hash — VARCHAR(255) — NOT NULL
  • nickname — VARCHAR(50) — NOT NULL
  • gender — ENUM('M','F','N')
  • birth_date — DATE
  • profile_image_url — VARCHAR(1024)
  • role — ENUM('USER','ADMIN') — NOT NULL
  • email_verified_at — DATETIME
  • terms_agreed_at — DATETIME
  • created_at — DATETIME — NOT NULL
  • updated_at — DATETIME — NOT NULL