hjk

Tables (53)

ai_analysis_decisions

  • id — BIGINT — Primary key — NOT NULL
  • analysis_result_id — BIGINT — Foreign key → ai_analysis_results.id — NOT NULL
  • user_id — BIGINT — Foreign key → users.id — NOT NULL
  • decision — ENUM('APPROVED', 'REJECTED') — NOT NULL
  • idempotency_key — VARCHAR(64) — NOT NULL
  • decided_at — DATETIME(6) — NOT NULL

ai_analysis_result_items

  • id — BIGINT — Primary key — NOT NULL
  • analysis_result_id — BIGINT — Foreign key → ai_analysis_results.id — NOT NULL
  • item_type — ENUM('RECENT_NEED', 'INTEREST', 'RECOMMENDATION_HINT', 'LONG_TERM_TRAIT') — NOT NULL
  • label — VARCHAR(200) — NOT NULL
  • normalized_key — VARCHAR(200)
  • confidence — DECIMAL(5,4)
  • priority_order — TINYINT — NOT NULL
  • created_at — DATETIME(6) — NOT NULL

ai_analysis_results

  • id — BIGINT — Primary key — NOT NULL
  • analysis_run_id — BIGINT — Foreign key → ai_analysis_runs.id — NOT NULL
  • summary_text — VARCHAR(1000)
  • generated_at — DATETIME(6) — NOT NULL

ai_analysis_runs

  • id — BIGINT — Primary key — NOT NULL
  • conversation_id — BIGINT — Foreign key → ai_conversations.id — NOT NULL
  • idempotency_key — VARCHAR(64) — NOT NULL
  • based_through_sequence — BIGINT — NOT NULL
  • analysis_status — ENUM('QUEUED', 'RUNNING', 'DELAYED', 'AWAITING_REVIEW', 'APPROVED', 'REJECTED', 'FAILED') — NOT NULL
  • progress_percent — TINYINT — NOT NULL
  • model_version — VARCHAR(100) — NOT NULL
  • prompt_version — VARCHAR(100) — NOT NULL
  • started_at — DATETIME(6)
  • delayed_at — DATETIME(6)
  • finished_at — DATETIME(6)
  • failure_code — VARCHAR(100)
  • failure_message — VARCHAR(1000)
  • active_conversation_id — BIGINT
  • created_at — DATETIME(6) — NOT NULL
  • updated_at — DATETIME(6) — NOT NULL

ai_conversations

  • id — BIGINT — Primary key — NOT NULL
  • public_id — BINARY(16) — NOT NULL
  • user_id — BIGINT — Foreign key → users.id — NOT NULL
  • conversation_status — ENUM('READY', 'ACTIVE', 'RESPONDING', 'ANALYZING', 'ANALYSIS_DELAYED', 'REVIEW_REQUIRED', 'COMPLETED', 'FAILED') — NOT NULL
  • analysis_progress — TINYINT — NOT NULL
  • next_sequence_no — BIGINT — NOT NULL
  • started_at — DATETIME(6) — Set only by first valid user message
  • completed_at — DATETIME(6)
  • row_version — BIGINT — NOT NULL
  • created_at — DATETIME(6) — NOT NULL
  • updated_at — DATETIME(6) — NOT NULL

ai_messages

  • id — BIGINT — Primary key — NOT NULL
  • conversation_id — BIGINT — Foreign key → ai_conversations.id — NOT NULL
  • sequence_no — BIGINT — NOT NULL
  • sender_type — ENUM('USER', 'AI', 'SYSTEM') — NOT NULL
  • message_text — TEXT — NOT NULL
  • delivery_status — ENUM('PENDING', 'SENT', 'FAILED') — NOT NULL
  • client_request_id — VARCHAR(64) — NOT NULL
  • failure_code — VARCHAR(100)
  • sent_at — DATETIME(6)
  • created_at — DATETIME(6) — NOT NULL
  • updated_at — DATETIME(6) — NOT NULL

anonymous_chat_rooms

  • id — BIGINT — Primary key — NOT NULL
  • public_id — BINARY(16) — NOT NULL
  • anonymous_question_id — BIGINT — Foreign key → anonymous_questions.id — NOT NULL
  • room_status — ENUM('ACTIVE', 'EXPIRED', 'CLOSED') — NOT NULL
  • first_opened_at — DATETIME(6) — NOT NULL
  • expires_at — DATETIME(6)
  • next_sequence_no — BIGINT — NOT NULL
  • created_at — DATETIME(6) — NOT NULL
  • updated_at — DATETIME(6) — NOT NULL

anonymous_messages

  • id — BIGINT — Primary key — NOT NULL
  • anonymous_room_id — BIGINT — Foreign key → anonymous_chat_rooms.id — NOT NULL
  • sender_user_id — BIGINT — Foreign key → users.id — NOT NULL — Internal only; never expose identity to the peer
  • sequence_no — BIGINT — NOT NULL
  • message_text — VARCHAR(500) — NOT NULL
  • client_request_id — VARCHAR(64) — NOT NULL
  • message_status — ENUM('SENT', 'FAILED', 'REDACTED') — NOT NULL
  • created_at — DATETIME(6) — NOT NULL
  • redacted_at — DATETIME(6)

anonymous_questions

  • id — BIGINT — Primary key — NOT NULL
  • public_id — BINARY(16) — NOT NULL
  • requester_user_id — BIGINT — Foreign key → users.id — NOT NULL
  • recipient_user_id — BIGINT — Foreign key → users.id — NOT NULL
  • product_id — BIGINT — Foreign key → products.id — NOT NULL
  • recommendation_item_id — BIGINT — Foreign key → recommendation_items.id
  • idempotency_key — VARCHAR(64) — NOT NULL
  • question_status — ENUM('PENDING_UNREAD', 'OPENED', 'EXPIRED_UNREAD', 'EXPIRED_OPENED', 'CANCELLED') — NOT NULL
  • created_at — DATETIME(6) — NOT NULL
  • unread_expires_at — DATETIME(6)
  • first_opened_at — DATETIME(6)
  • user_visible_until — DATETIME(6)
  • evidence_retain_until — DATETIME(6)
  • purge_after — DATETIME(6)
  • updated_at — DATETIME(6) — NOT NULL

anonymous_report_reasons

  • id — BIGINT — Primary key — NOT NULL
  • reason_code — VARCHAR(64) — NOT NULL
  • display_name — VARCHAR(100) — NOT NULL
  • is_active — BOOLEAN — NOT NULL
  • sort_order — SMALLINT — NOT NULL

anonymous_reports

  • id — BIGINT — Primary key — NOT NULL
  • anonymous_room_id — BIGINT — Foreign key → anonymous_chat_rooms.id — NOT NULL
  • reporter_user_id — BIGINT — Foreign key → users.id — NOT NULL
  • reported_user_id — BIGINT — Foreign key → users.id — NOT NULL
  • reason_id — BIGINT — Foreign key → anonymous_report_reasons.id — NOT NULL
  • evidence_message_id — BIGINT — Foreign key → anonymous_messages.id
  • idempotency_key — VARCHAR(64) — NOT NULL
  • report_status — ENUM('RECEIVED', 'REVIEWING', 'ACTIONED', 'DISMISSED') — NOT NULL
  • created_at — DATETIME(6) — NOT NULL
  • resolved_at — DATETIME(6)

auth_audit_logs

  • id — BIGINT — Primary key — NOT NULL
  • user_id — BIGINT — Foreign key → users.id
  • oauth_account_id — BIGINT — Foreign key → oauth_accounts.id
  • auth_session_id — BIGINT — Foreign key → auth_sessions.id
  • action_type — ENUM('LOGIN_SUCCESS', 'LOGIN_FAILURE', 'SESSION_ISSUED', 'SESSION_REVOKED', 'ACCOUNT_ACTIVATED', 'ACCOUNT_SUSPENDED', 'ACCOUNT_WITHDRAWN') — NOT NULL
  • previous_status — VARCHAR(32)
  • next_status — VARCHAR(32)
  • reason_code — VARCHAR(100)
  • ip_address_hash — BINARY(32)
  • user_agent_hash — BINARY(32)
  • occurred_at — DATETIME(6) — NOT NULL

auth_sessions

  • id — BIGINT — Primary key — NOT NULL
  • user_id — BIGINT — Foreign key → users.id — NOT NULL
  • session_token_hash — BINARY(32) — NOT NULL
  • refresh_token_hash — BINARY(32)
  • device_fingerprint_hash — BINARY(32)
  • device_name — VARCHAR(100)
  • issued_at — DATETIME(6) — NOT NULL
  • expires_at — DATETIME(6) — NOT NULL
  • last_seen_at — DATETIME(6)
  • revoked_at — DATETIME(6)
  • revoke_reason — ENUM('LOGOUT', 'WITHDRAWAL', 'SUSPENSION', 'EXPIRED', 'ROTATED', 'SECURITY')

calendar_connections

  • id — BIGINT — Primary key — NOT NULL
  • user_id — BIGINT — Foreign key → users.id — NOT NULL
  • provider — ENUM('KAKAO') — NOT NULL
  • connection_status — ENUM('ACTIVE', 'DISCONNECTED', 'ERROR') — NOT NULL
  • access_token_ciphertext — VARBINARY(4096) — NOT NULL
  • refresh_token_ciphertext — VARBINARY(4096)
  • encryption_key_version — SMALLINT — NOT NULL
  • token_expires_at — DATETIME(6)
  • last_synced_at — DATETIME(6)
  • disconnected_at — DATETIME(6)
  • created_at — DATETIME(6) — NOT NULL
  • updated_at — DATETIME(6) — NOT NULL

calendar_sync_runs

  • id — BIGINT — Primary key — NOT NULL
  • calendar_connection_id — BIGINT — Foreign key → calendar_connections.id — NOT NULL
  • sync_direction — ENUM('IMPORT', 'EXPORT', 'BIDIRECTIONAL') — NOT NULL
  • sync_status — ENUM('RUNNING', 'SUCCEEDED', 'FAILED', 'SKIPPED_DISCONNECTED') — NOT NULL
  • started_at — DATETIME(6) — NOT NULL
  • finished_at — DATETIME(6)
  • imported_count — INT — NOT NULL
  • exported_count — INT — NOT NULL
  • error_code — VARCHAR(100)
  • error_message — VARCHAR(1000)

consent_history

  • id — BIGINT — Primary key — NOT NULL
  • user_id — BIGINT — Foreign key → users.id — NOT NULL
  • policy_id — BIGINT — Foreign key → consent_policies.id — NOT NULL
  • consent_action — ENUM('AGREED', 'WITHDRAWN') — NOT NULL
  • idempotency_key — VARCHAR(64) — NOT NULL
  • occurred_at — DATETIME(6) — NOT NULL
  • source_channel — ENUM('ONBOARDING', 'SETTINGS', 'POLICY_RECONSENT', 'ADMIN') — NOT NULL

consent_policies

  • id — BIGINT — Primary key — NOT NULL
  • policy_code — VARCHAR(64) — NOT NULL
  • policy_version — VARCHAR(32) — NOT NULL
  • title — VARCHAR(200) — NOT NULL
  • is_required — BOOLEAN — NOT NULL
  • requires_reconsent — BOOLEAN — NOT NULL
  • effective_at — DATETIME(6) — NOT NULL
  • retired_at — DATETIME(6)
  • content_hash — BINARY(32) — NOT NULL
  • created_at — DATETIME(6) — NOT NULL

device_push_tokens

  • id — BIGINT — Primary key — NOT NULL
  • user_id — BIGINT — Foreign key → users.id — NOT NULL
  • platform — ENUM('IOS', 'ANDROID', 'WEB') — NOT NULL
  • token_hash — BINARY(32) — NOT NULL
  • token_ciphertext — VARBINARY(4096) — NOT NULL
  • encryption_key_version — SMALLINT — NOT NULL
  • is_active — BOOLEAN — NOT NULL
  • last_registered_at — DATETIME(6) — NOT NULL
  • revoked_at — DATETIME(6)

domain_outbox_events

  • id — BIGINT — Primary key — NOT NULL
  • aggregate_type — VARCHAR(64) — NOT NULL
  • aggregate_id — BIGINT — NOT NULL
  • event_type — VARCHAR(100) — NOT NULL
  • deduplication_key — VARCHAR(160) — NOT NULL
  • payload — JSON — NOT NULL
  • publish_status — ENUM('PENDING', 'PUBLISHING', 'PUBLISHED', 'FAILED') — NOT NULL
  • available_at — DATETIME(6) — NOT NULL
  • published_at — DATETIME(6)
  • attempt_count — SMALLINT — NOT NULL
  • last_error — VARCHAR(1000)
  • created_at — DATETIME(6) — NOT NULL

events

  • id — BIGINT — Primary key — NOT NULL
  • owner_user_id — BIGINT — Foreign key → users.id — NOT NULL — User who owns/registered the event
  • subject_user_id — BIGINT — Foreign key → users.id — NOT NULL — Person the event is about
  • event_type — ENUM('BIRTHDAY', 'ANNIVERSARY', 'CUSTOM') — NOT NULL
  • source_type — ENUM('PROFILE', 'USER', 'KAKAO_CALENDAR') — NOT NULL
  • source_key — VARCHAR(100) — e.g. BIRTH_DATE or profile anniversary key
  • title — VARCHAR(100) — NOT NULL
  • event_date — DATE — NOT NULL — Anchor date; recurring birthday may use a neutral anchor year
  • recurrence_type — ENUM('NONE', 'YEARLY') — NOT NULL
  • visibility — ENUM('PRIVATE', 'FRIENDS') — NOT NULL
  • event_status — ENUM('ACTIVE', 'DELETED') — NOT NULL
  • deleted_at — DATETIME(6)
  • created_at — DATETIME(6) — NOT NULL
  • updated_at — DATETIME(6) — NOT NULL

external_event_links

  • id — BIGINT — Primary key — NOT NULL
  • calendar_connection_id — BIGINT — Foreign key → calendar_connections.id — NOT NULL
  • event_id — BIGINT — Foreign key → events.id — NOT NULL
  • external_event_id — VARCHAR(255) — NOT NULL
  • external_etag — VARCHAR(255)
  • link_status — ENUM('LINKED', 'REMOTE_DELETED', 'DISCONNECTED') — NOT NULL
  • last_synced_at — DATETIME(6)
  • created_at — DATETIME(6) — NOT NULL
  • updated_at — DATETIME(6) — NOT NULL

friend_pokes

  • id — BIGINT — Primary key — NOT NULL
  • friendship_id — BIGINT — Foreign key → friendships.id — NOT NULL
  • sender_user_id — BIGINT — Foreign key → users.id — NOT NULL
  • recipient_user_id — BIGINT — Foreign key → users.id — NOT NULL
  • idempotency_key — VARCHAR(64) — NOT NULL
  • eligibility_reason — ENUM('NO_AI_CONVERSATION_DATA') — NOT NULL
  • created_at — DATETIME(6) — NOT NULL

friendship_user_settings

  • friendship_id — BIGINT — Foreign key → friendships.id — NOT NULL
  • user_id — BIGINT — Foreign key → users.id — NOT NULL
  • is_favorite — BOOLEAN — NOT NULL
  • favorite_changed_at — DATETIME(6)
  • created_at — DATETIME(6) — NOT NULL
  • updated_at — DATETIME(6) — NOT NULL

friendships

  • id — BIGINT — Primary key — NOT NULL
  • requester_user_id — BIGINT — Foreign key → users.id — NOT NULL
  • addressee_user_id — BIGINT — Foreign key → users.id — NOT NULL
  • pair_low_user_id — BIGINT
  • pair_high_user_id — BIGINT
  • friendship_status — ENUM('PENDING', 'ACCEPTED', 'REMOVED') — NOT NULL
  • requested_at — DATETIME(6) — NOT NULL
  • accepted_at — DATETIME(6)
  • removed_at — DATETIME(6)
  • created_at — DATETIME(6) — NOT NULL
  • updated_at — DATETIME(6) — NOT NULL

notification_deliveries

  • id — BIGINT — Primary key — NOT NULL
  • notification_id — BIGINT — Foreign key → notifications.id — NOT NULL
  • channel_type — ENUM('IN_APP', 'PUSH') — NOT NULL
  • device_push_token_id — BIGINT — Foreign key → device_push_tokens.id
  • delivery_device_key — BIGINT
  • attempt_no — SMALLINT — NOT NULL
  • delivery_status — ENUM('PENDING', 'SENT', 'DELIVERED', 'FAILED', 'SUPPRESSED') — NOT NULL
  • suppression_reason — ENUM('USER_SETTING', 'NO_MARKETING_CONSENT', 'USER_BLOCK', 'NO_DEVICE', 'TARGET_EXPIRED')
  • provider_message_id — VARCHAR(255)
  • attempted_at — DATETIME(6)
  • delivered_at — DATETIME(6)
  • failure_code — VARCHAR(100)
  • failure_message — VARCHAR(1000)
  • created_at — DATETIME(6) — NOT NULL

notification_preferences

  • notification_type — ENUM('FRIEND_JOINED', 'FRIEND_BIRTHDAY', 'EVENT', 'POKE', 'ANONYMOUS_QUESTION', 'CHAT_MESSAGE', 'MARKETING') — Primary key — NOT NULL
  • user_id — BIGINT — Foreign key → users.id — NOT NULL
  • in_app_enabled — BOOLEAN — NOT NULL
  • push_enabled — BOOLEAN — NOT NULL
  • changed_at — DATETIME(6) — NOT NULL

notifications

  • id — BIGINT — Primary key — NOT NULL
  • public_id — BINARY(16) — NOT NULL
  • recipient_user_id — BIGINT — Foreign key → users.id — NOT NULL
  • actor_user_id — BIGINT — Foreign key → users.id — Internal actor; omit for anonymous responses
  • notification_type — ENUM('FRIEND_JOINED', 'FRIEND_BIRTHDAY', 'EVENT', 'POKE', 'ANONYMOUS_QUESTION', 'CHAT_MESSAGE', 'MARKETING') — NOT NULL
  • source_event_key — VARCHAR(160) — NOT NULL — Stable domain-event idempotency key
  • title — VARCHAR(200) — NOT NULL
  • body — VARCHAR(1000) — NOT NULL
  • event_id — BIGINT — Foreign key → events.id
  • friendship_id — BIGINT — Foreign key → friendships.id
  • friend_poke_id — BIGINT — Foreign key → friend_pokes.id
  • anonymous_question_id — BIGINT — Foreign key → anonymous_questions.id
  • anonymous_room_id — BIGINT — Foreign key → anonymous_chat_rooms.id
  • ai_conversation_id — BIGINT — Foreign key → ai_conversations.id
  • product_id — BIGINT — Foreign key → products.id
  • target_status — ENUM('ACTIVE', 'UNAVAILABLE', 'EXPIRED') — NOT NULL
  • occurred_at — DATETIME(6) — NOT NULL
  • read_at — DATETIME(6)
  • created_at — DATETIME(6) — NOT NULL

oauth_accounts

  • id — BIGINT — Primary key — NOT NULL
  • user_id — BIGINT — Foreign key → users.id — NOT NULL
  • provider — ENUM('KAKAO') — NOT NULL
  • provider_subject_hash — BINARY(32) — NOT NULL — Deterministic HMAC/SHA-256 lookup key
  • provider_subject_ciphertext — VARBINARY(512) — NOT NULL
  • encryption_key_version — SMALLINT — NOT NULL
  • connected_at — DATETIME(6) — NOT NULL
  • disconnected_at — DATETIME(6)
  • created_at — DATETIME(6) — NOT NULL
  • updated_at — DATETIME(6) — NOT NULL

oauth_token_credentials

  • id — BIGINT — Primary key — NOT NULL
  • oauth_account_id — BIGINT — Foreign key → oauth_accounts.id — NOT NULL
  • access_token_ciphertext — VARBINARY(4096) — NOT NULL
  • refresh_token_ciphertext — VARBINARY(4096)
  • encryption_key_version — SMALLINT — NOT NULL
  • access_token_expires_at — DATETIME(6) — NOT NULL
  • refresh_token_expires_at — DATETIME(6)
  • issued_at — DATETIME(6) — NOT NULL
  • revoked_at — DATETIME(6)
  • revoke_reason — ENUM('REFRESHED', 'LOGOUT', 'WITHDRAWAL', 'SUSPENSION', 'PROVIDER_DISCONNECT', 'SECURITY')
  • active_oauth_account_id — BIGINT

onboarding_step_saves

  • step_no — TINYINT — Primary key — NOT NULL
  • user_id — BIGINT — Foreign key → users.id — NOT NULL
  • idempotency_key — VARCHAR(64) — NOT NULL
  • payload_checksum — BINARY(32) — NOT NULL
  • completed_at — DATETIME(6) — NOT NULL
  • created_at — DATETIME(6) — NOT NULL

preference_terms

  • id — BIGINT — Primary key — NOT NULL
  • term_type — ENUM('INTEREST_CATEGORY', 'ALLERGEN', 'GIFT_EXCLUSION', 'PRODUCT_ATTRIBUTE') — NOT NULL
  • term_code — VARCHAR(64) — NOT NULL
  • display_name — VARCHAR(100) — NOT NULL
  • is_active — BOOLEAN — NOT NULL
  • sort_order — SMALLINT — NOT NULL
  • created_at — DATETIME(6) — NOT NULL
  • updated_at — DATETIME(6) — NOT NULL

product_categories

  • id — BIGINT — Primary key — NOT NULL
  • category_code — VARCHAR(64) — NOT NULL
  • display_name — VARCHAR(100) — NOT NULL
  • parent_category_id — BIGINT — Foreign key → product_categories.id
  • is_active — BOOLEAN — NOT NULL
  • sort_order — SMALLINT — NOT NULL

product_category_assignments

  • product_id — BIGINT — Foreign key → products.id — NOT NULL
  • category_id — BIGINT — Foreign key → product_categories.id — NOT NULL
  • is_primary — BOOLEAN — NOT NULL
  • created_at — DATETIME(6) — NOT NULL

product_dislike_reasons

  • id — BIGINT — Primary key — NOT NULL
  • reason_code — VARCHAR(64) — NOT NULL
  • display_name — VARCHAR(100) — NOT NULL
  • is_active — BOOLEAN — NOT NULL
  • sort_order — SMALLINT — NOT NULL

product_external_clicks

  • id — BIGINT — Primary key — NOT NULL
  • user_id — BIGINT — Foreign key → users.id — NOT NULL
  • product_id — BIGINT — Foreign key → products.id — NOT NULL
  • product_external_link_id — BIGINT — Foreign key → product_external_links.id — NOT NULL
  • recommendation_item_id — BIGINT — Foreign key → recommendation_items.id
  • anonymous_question_id — BIGINT — Foreign key → anonymous_questions.id
  • detail_type — ENUM('SELF_TASTE', 'FRIEND_TASTE', 'PROPOSED_GIFT', 'RECEIVED_GIFT') — NOT NULL
  • click_event_type — ENUM('OPEN_PURCHASE', 'OPEN_DETAIL') — NOT NULL
  • idempotency_key — VARCHAR(64) — NOT NULL
  • occurred_at — DATETIME(6) — NOT NULL

product_external_links

  • id — BIGINT — Primary key — NOT NULL
  • product_id — BIGINT — Foreign key → products.id — NOT NULL
  • link_type — ENUM('PURCHASE', 'DETAIL') — NOT NULL
  • provider_name — VARCHAR(100) — NOT NULL
  • destination_url — VARCHAR(2048) — NOT NULL
  • is_active — BOOLEAN — NOT NULL
  • created_at — DATETIME(6) — NOT NULL
  • updated_at — DATETIME(6) — NOT NULL

product_feedback_current

  • id — BIGINT — Primary key — NOT NULL
  • respondent_user_id — BIGINT — Foreign key → users.id — NOT NULL — Internal identity; omit from anonymous API responses
  • product_id — BIGINT — Foreign key → products.id — NOT NULL
  • recommendation_item_id — BIGINT — Foreign key → recommendation_items.id
  • anonymous_question_id — BIGINT — Foreign key → anonymous_questions.id
  • feedback_context — ENUM('SELF_RECOMMENDATION', 'FRIEND_RECOMMENDATION', 'PROPOSED_GIFT', 'RECEIVED_GIFT') — NOT NULL
  • feedback_value — ENUM('LIKE', 'DISLIKE') — NOT NULL
  • dislike_reason_id — BIGINT — Foreign key → product_dislike_reasons.id
  • current_version — INT — NOT NULL
  • updated_at — DATETIME(6) — NOT NULL
  • created_at — DATETIME(6) — NOT NULL

product_feedback_history

  • id — BIGINT — Primary key — NOT NULL
  • current_feedback_id — BIGINT — Foreign key → product_feedback_current.id — NOT NULL
  • respondent_user_id — BIGINT — Foreign key → users.id — NOT NULL
  • product_id — BIGINT — Foreign key → products.id — NOT NULL
  • feedback_version — INT — NOT NULL
  • feedback_context — ENUM('SELF_RECOMMENDATION', 'FRIEND_RECOMMENDATION', 'PROPOSED_GIFT', 'RECEIVED_GIFT') — NOT NULL
  • feedback_value — ENUM('LIKE', 'DISLIKE') — NOT NULL
  • dislike_reason_id — BIGINT — Foreign key → product_dislike_reasons.id
  • idempotency_key — VARCHAR(64) — NOT NULL
  • recorded_at — DATETIME(6) — NOT NULL

product_term_assignments

  • product_id — BIGINT — Foreign key → products.id — NOT NULL
  • term_id — BIGINT — Foreign key → preference_terms.id — NOT NULL
  • relevance_score — DECIMAL(5,4)
  • created_at — DATETIME(6) — NOT NULL

products

  • id — BIGINT — Primary key — NOT NULL
  • public_id — BINARY(16) — NOT NULL
  • source_provider — VARCHAR(64) — NOT NULL
  • source_product_id — VARCHAR(255) — NOT NULL
  • product_name — VARCHAR(300)
  • description_text — TEXT
  • image_url — VARCHAR(2048)
  • merchant_name — VARCHAR(200)
  • price_amount — DECIMAL(12,2)
  • currency_code — CHAR(3) — NOT NULL
  • product_status — ENUM('ACTIVE', 'UNAVAILABLE', 'DELETED') — NOT NULL
  • source_updated_at — DATETIME(6)
  • created_at — DATETIME(6) — NOT NULL
  • updated_at — DATETIME(6) — NOT NULL

recommendation_batches

  • id — BIGINT — Primary key — NOT NULL
  • recommendation_session_id — BIGINT — Foreign key → recommendation_sessions.id — NOT NULL
  • batch_sequence — INT — NOT NULL
  • request_type — ENUM('INITIAL', 'REPLACEMENT') — NOT NULL
  • idempotency_key — VARCHAR(64) — NOT NULL
  • batch_status — ENUM('PENDING', 'SUCCEEDED', 'EMPTY', 'FAILED') — NOT NULL
  • failure_code — VARCHAR(100)
  • created_at — DATETIME(6) — NOT NULL
  • completed_at — DATETIME(6)

recommendation_context_snapshots

  • id — BIGINT — Primary key — NOT NULL
  • recommendation_session_id — BIGINT — Foreign key → recommendation_sessions.id — NOT NULL
  • context_type — ENUM('LONG_TERM_TRAIT', 'RECENT_INTEREST', 'USER_INTEREST', 'ALLERGY', 'GIFT_EXCLUSION', 'SYSTEM_RULE') — NOT NULL
  • source_reference_id — BIGINT
  • label — VARCHAR(200) — NOT NULL
  • snapshot_value — JSON
  • priority_order — SMALLINT — NOT NULL
  • created_at — DATETIME(6) — NOT NULL

recommendation_item_keywords

  • priority_order — TINYINT — Primary key — NOT NULL
  • recommendation_item_id — BIGINT — Foreign key → recommendation_items.id — NOT NULL
  • keyword_label — VARCHAR(100) — NOT NULL
  • source_context_snapshot_id — BIGINT — Foreign key → recommendation_context_snapshots.id

recommendation_items

  • id — BIGINT — Primary key — NOT NULL
  • recommendation_session_id — BIGINT — Foreign key → recommendation_batches.recommendation_session_id — NOT NULL
  • recommendation_batch_id — BIGINT — Foreign key → recommendation_batches.id — NOT NULL
  • product_id — BIGINT — Foreign key → products.id — NOT NULL
  • detail_type — ENUM('SELF_TASTE', 'FRIEND_TASTE', 'PROPOSED_GIFT') — NOT NULL
  • rank_order — SMALLINT — NOT NULL
  • score — DECIMAL(10,6)
  • recommendation_reason — VARCHAR(1000) — NOT NULL
  • created_at — DATETIME(6) — NOT NULL

recommendation_sessions

  • id — BIGINT — Primary key — NOT NULL
  • public_id — BINARY(16) — NOT NULL
  • requester_user_id — BIGINT — Foreign key → users.id — NOT NULL
  • target_user_id — BIGINT — Foreign key → users.id — NOT NULL
  • target_type — ENUM('SELF', 'FRIEND') — NOT NULL
  • min_budget — DECIMAL(12,2) — NOT NULL
  • max_budget — DECIMAL(12,2) — NOT NULL
  • currency_code — CHAR(3) — NOT NULL
  • context_hash — BINARY(32) — NOT NULL
  • algorithm_version — VARCHAR(100) — NOT NULL
  • idempotency_key — VARCHAR(64) — NOT NULL
  • session_status — ENUM('ACTIVE', 'COMPLETED', 'CANCELLED') — NOT NULL
  • created_at — DATETIME(6) — NOT NULL
  • updated_at — DATETIME(6) — NOT NULL

service_feedback_reports

  • id — BIGINT — Primary key — NOT NULL
  • user_id — BIGINT — Foreign key → users.id
  • report_type — ENUM('SCREEN_NOT_VISIBLE', 'REPEATED_FAILURE', 'BUTTON_NOT_WORKING', 'UNEXPECTED_RESULT', 'OTHER') — NOT NULL
  • detail_text — VARCHAR(500)
  • error_code — VARCHAR(100)
  • error_type — VARCHAR(100)
  • screen_id — VARCHAR(64)
  • error_occurred_at — DATETIME(6)
  • app_version — VARCHAR(50)
  • include_diagnostic_logs — BOOLEAN — NOT NULL
  • diagnostic_bundle_ref — VARCHAR(255) — Reference only; sensitive logs live in protected log storage
  • report_status — ENUM('RECEIVED', 'REVIEWING', 'RESOLVED', 'DISMISSED') — NOT NULL
  • created_at — DATETIME(6) — NOT NULL
  • resolved_at — DATETIME(6)

user_block_history

  • id — BIGINT — Primary key — NOT NULL
  • user_block_id — BIGINT — Foreign key → user_blocks.id — NOT NULL
  • actor_user_id — BIGINT — Foreign key → users.id — NOT NULL
  • block_action — ENUM('BLOCKED', 'UNBLOCKED') — NOT NULL
  • idempotency_key — VARCHAR(64) — NOT NULL
  • occurred_at — DATETIME(6) — NOT NULL

user_blocks

  • id — BIGINT — Primary key — NOT NULL
  • blocker_user_id — BIGINT — Foreign key → users.id — NOT NULL
  • blocked_user_id — BIGINT — Foreign key → users.id — NOT NULL
  • is_active — BOOLEAN — NOT NULL
  • blocked_at — DATETIME(6) — NOT NULL
  • unblocked_at — DATETIME(6)
  • updated_at — DATETIME(6) — NOT NULL

user_consent_states

  • user_id — BIGINT — Foreign key → users.id — NOT NULL
  • policy_id — BIGINT — Foreign key → consent_policies.id — NOT NULL
  • latest_history_id — BIGINT — Foreign key → consent_history.id — NOT NULL
  • is_agreed — BOOLEAN — NOT NULL
  • agreed_at — DATETIME(6)
  • withdrawn_at — DATETIME(6)
  • updated_at — DATETIME(6) — NOT NULL

user_preference_facts

  • id — BIGINT — Primary key — NOT NULL
  • user_id — BIGINT — Foreign key → users.id — NOT NULL
  • fact_type — ENUM('LONG_TERM_TRAIT', 'RECENT_INTEREST', 'RECOMMENDATION_HINT') — NOT NULL
  • source_type — ENUM('USER', 'AI', 'BEHAVIOR') — NOT NULL
  • source_result_item_id — BIGINT — Foreign key → ai_analysis_result_items.id
  • label — VARCHAR(200) — NOT NULL
  • normalized_key — VARCHAR(200)
  • confidence — DECIMAL(5,4)
  • visibility — ENUM('PRIVATE', 'FRIENDS') — NOT NULL
  • fact_status — ENUM('ACTIVE', 'REJECTED', 'EXPIRED', 'REMOVED') — NOT NULL
  • priority_order — SMALLINT — NOT NULL
  • valid_from — DATETIME(6) — NOT NULL
  • valid_until — DATETIME(6)
  • created_at — DATETIME(6) — NOT NULL
  • updated_at — DATETIME(6) — NOT NULL

user_profiles

  • user_id — BIGINT — Foreign key → users.id — NOT NULL
  • nickname — VARCHAR(50) — NOT NULL
  • profile_image_url — VARCHAR(2048)
  • gender_ciphertext — VARBINARY(512) — Encrypted gender value
  • gender_key_version — SMALLINT
  • birth_date_ciphertext — VARBINARY(512) — Encrypted ISO birth date; no plaintext DOB is stored here
  • birth_date_key_version — SMALLINT
  • birthday_visibility — ENUM('PRIVATE', 'FRIENDS') — NOT NULL
  • created_at — DATETIME(6) — NOT NULL
  • updated_at — DATETIME(6) — NOT NULL

user_term_preferences

  • relation_type — ENUM('INTEREST', 'ALLERGY', 'EXCLUDED_GIFT') — Primary key — NOT NULL
  • user_id — BIGINT — Foreign key → users.id — NOT NULL
  • term_id — BIGINT — Foreign key → preference_terms.id — NOT NULL
  • source_type — ENUM('ONBOARDING', 'SETTINGS') — NOT NULL
  • selected_at — DATETIME(6) — NOT NULL

users

  • id — BIGINT — Primary key — NOT NULL
  • public_id — BINARY(16) — NOT NULL
  • account_status — ENUM('ONBOARDING', 'ACTIVE', 'SUSPENDED', 'WITHDRAWN') — NOT NULL
  • onboarding_step — TINYINT — NOT NULL — Last fully saved step, 0..4
  • onboarding_completed_at — DATETIME(6)
  • theme — ENUM('LIGHT', 'DARK', 'SYSTEM') — NOT NULL
  • time_zone — VARCHAR(64) — NOT NULL
  • last_login_at — DATETIME(6)
  • suspended_at — DATETIME(6)
  • withdrawn_at — DATETIME(6)
  • row_version — BIGINT — NOT NULL
  • created_at — DATETIME(6) — NOT NULL
  • updated_at — DATETIME(6) — NOT NULL