nu-03

Tables (10)

auth_sessions

  • id — BIGINT — Primary key — NOT NULL
  • user_id — BIGINT — Foreign key → users.id — NOT NULL
  • refresh_token_hash — BINARY(32) — NOT NULL
  • device_name — VARCHAR(100)
  • ip_address — VARBINARY(16) — IPv4 or IPv6
  • refresh_expires_at — DATETIME(6) — NOT NULL
  • last_used_at — DATETIME(6)
  • revoked_at — DATETIME(6)
  • revoke_reason — ENUM('LOGOUT', 'ROTATED', 'WITHDRAWN', 'SECURITY')
  • created_at — DATETIME(6) — NOT NULL
  • updated_at — DATETIME(6) — NOT NULL

kakao_calendar_connections

  • user_id — BIGINT — Foreign key → users.id — NOT NULL
  • status — ENUM('CONNECTED', 'DISCONNECTED', 'EXPIRED', 'ERROR') — NOT NULL
  • connected_at — DATETIME(6)
  • disconnected_at — DATETIME(6)
  • updated_at — DATETIME(6) — NOT NULL

product_clicks

  • id — BIGINT — Primary key — NOT NULL
  • user_id — BIGINT — Foreign key → users.id — NOT NULL
  • target_user_id — BIGINT — Foreign key → users.id — NOT NULL — user_id와 동일하면, 본인 추천 상품
  • product_id — BIGINT — Foreign key → products.id — NOT NULL
  • recommendation_type — ENUM('SELF', 'FRIEND') — NOT NULL
  • clicked_url — VARCHAR(2048) — NOT NULL
  • clicked_at — DATETIME(6) — NOT NULL
  • follow_up_at — DATETIME(6) — NOT NULL — clicked_at + 7일
  • follow_up_status — ENUM('PENDING', 'ASKED', 'ANSWERED') — NOT NULL
  • asked_at — DATETIME(6)
  • purchase_status — ENUM('PURCHASED', 'NOT_PURCHASED')
  • answered_at — DATETIME(6)
  • created_at — DATETIME(6) — NOT NULL
  • updated_at — DATETIME(6) — NOT NULL

product_feedbacks

  • user_id — BIGINT — Foreign key → users.id — NOT NULL
  • product_id — BIGINT — Foreign key → products.id — NOT NULL
  • feedback_type — ENUM('POSITIVE', 'NEGATIVE') — NOT NULL
  • dislike_reason — VARCHAR(500)
  • is_anonymous — BOOLEAN — NOT NULL
  • created_at — DATETIME(6) — NOT NULL
  • updated_at — DATETIME(6) — NOT NULL

products

  • id — BIGINT — Primary key — NOT NULL
  • external_id — VARCHAR(255)
  • name — VARCHAR(300) — NOT NULL
  • category — VARCHAR(100)
  • description — TEXT
  • price — DECIMAL(12, 2)
  • image_url — VARCHAR(2048)
  • seller_name — VARCHAR(200)
  • purchase_url — VARCHAR(2048)
  • status — ENUM('ACTIVE', 'SOLD_OUT', 'UNAVAILABLE') — NOT NULL
  • created_at — DATETIME(6) — NOT NULL
  • updated_at — DATETIME(6) — NOT NULL

recommendation_products

  • user_id — BIGINT — Foreign key → users.id — NOT NULL
  • product_id — BIGINT — Foreign key → products.id — NOT NULL
  • score — DECIMAL(8, 6) — NOT NULL
  • reason — VARCHAR(500)
  • taste_keywords — JSON
  • recommended_at — DATETIME(6) — NOT NULL
  • updated_at — DATETIME(6) — NOT NULL

user_devices

  • id (id2) — BIGINT — Foreign key → users.id — NOT NULL
  • user_id — BIGINT — NOT NULL
  • device_id — VARCHAR(255) — NOT NULL
  • platform — ENUM('IOS', 'ANDROID', 'WEB') — NOT NULL
  • notification_permission — ENUM('UNKNOWN', 'ALLOWED', 'DENIED') — NOT NULL
  • push_token — VARCHAR(512)
  • updated_at — DATETIME(6) — NOT NULL

user_notification_settings

  • user_id — BIGINT — Foreign key → users.id — NOT NULL
  • friend_join_enabled — BOOLEAN — NOT NULL
  • friend_birthday_enabled — BOOLEAN — NOT NULL
  • event_enabled — BOOLEAN — NOT NULL
  • marketing_enabled — BOOLEAN — NOT NULL
  • created_at — DATETIME(6) — NOT NULL
  • updated_at — DATETIME(6) — NOT NULL

user_taste_profiles

  • user_id — BIGINT — Foreign key → users.id — NOT NULL
  • recent_tastes — JSON — NOT NULL
  • recent_interests — JSON — NOT NULL
  • ai_summary — TEXT — NOT NULL
  • created_at — DATETIME(6) — NOT NULL
  • updated_at — DATETIME(6) — NOT NULL
  • selected_tastes — JSON — 최대 5개
  • food_restrictions — JSON
  • unwanted_product — JSON

users

  • id — BIGINT — Primary key — NOT NULL
  • kakao_id — BIGINT — NOT NULL
  • nickname — VARCHAR(50) — NOT NULL
  • profile_image_url — VARCHAR(2048)
  • gender — ENUM('MALE', 'FEMALE') — NOT NULL
  • birth_date — DATE
  • onboarding_completed — BOOLEAN — NOT NULL
  • status — ENUM('ONBOARDING', 'ACTIVE', 'SUSPENDED', 'WITHDRAWN') — NOT NULL
  • theme — ENUM('LIGHT', 'DARK', 'SYSTEM') — NOT NULL
  • last_login_at — DATETIME(6)
  • created_at — DATETIME(6) — NOT NULL
  • updated_at — DATETIME(6) — NOT NULL