KGB_new
Tables (24)
auth_sessions
- id — BIGINT — Primary key — NOT NULL
- member_id — BIGINT — Foreign key → members.id — NOT NULL
- refresh_token_hash — VARCHAR(255) — NOT NULL
- expires_at — DATETIME(6) — NOT NULL
- revoked_at — DATETIME(6)
- last_used_at — DATETIME(6)
- created_at — DATETIME(6) — NOT NULL
content_images
- id — BIGINT — Primary key — NOT NULL
- content_id — BIGINT — Foreign key → tourism_contents.id — NOT NULL
- image_url — VARCHAR(2048) — NOT NULL
- image_url_hash — BINARY(32) — NOT NULL
- sort_order — INT — NOT NULL
- source_url — VARCHAR(2048)
- created_at — DATETIME(6) — NOT NULL
credit_products
- id — BIGINT — Primary key — NOT NULL
- name — VARCHAR(100) — NOT NULL
- credit_amount — INT — NOT NULL
- price — BIGINT — NOT NULL
- currency — CHAR(3) — NOT NULL
- status — VARCHAR(20) — NOT NULL
- deleted_at — DATETIME(6)
- created_at — DATETIME(6) — NOT NULL
- updated_at — DATETIME(6) — NOT NULL
credit_transactions
- id — BIGINT — Primary key — NOT NULL
- wallet_id — BIGINT — Foreign key → credit_wallets.id — NOT NULL
- type — VARCHAR(30) — NOT NULL
- credit_delta — INT — NOT NULL
- credit_balance_after — INT — NOT NULL
- order_id — BIGINT — Foreign key → orders.id
- generation_job_id — VARCHAR(50) — Foreign key → generation_jobs.id
- idempotency_key — VARCHAR(150) — NOT NULL
- created_at — DATETIME(6) — NOT NULL
credit_wallets
- id — BIGINT — Primary key — NOT NULL
- member_id — BIGINT — Foreign key → members.id — NOT NULL
- credit_balance — INT — NOT NULL
- created_at — DATETIME(6) — NOT NULL
- updated_at — DATETIME(6) — NOT NULL
event_details
- content_id — BIGINT — Foreign key → tourism_contents.id — NOT NULL
- start_date — DATE — NOT NULL
- end_date — DATE — NOT NULL
- operating_hours — VARCHAR(255)
- organizer — VARCHAR(200)
- updated_at — DATETIME(6) — NOT NULL
favorite_contents
- id — BIGINT — Primary key — NOT NULL
- member_id — BIGINT — Foreign key → members.id — NOT NULL
- content_id — BIGINT — Foreign key → tourism_contents.id — NOT NULL
- created_at — DATETIME(6) — NOT NULL
generation_jobs
- id — VARCHAR(50) — Primary key — NOT NULL
- member_id — BIGINT — Foreign key → members.id — NOT NULL
- guidebook_id — VARCHAR(50) — Foreign key → guidebooks.id
- job_type — VARCHAR(20) — NOT NULL
- status — VARCHAR(20) — NOT NULL
- request_payload — JSON — NOT NULL
- error_payload — JSON
- attempt_count — SMALLINT — NOT NULL
- idempotency_key — VARCHAR(100) — NOT NULL
- started_at — DATETIME(6)
- completed_at — DATETIME(6)
- created_at — DATETIME(6) — NOT NULL
- updated_at — DATETIME(6) — NOT NULL
- active_member_id — BIGINT
- cancel_requested_at — DATETIME(6)
guidebook_evaluations
- id — BIGINT — Primary key — NOT NULL
- guidebook_id — VARCHAR(50) — Foreign key → guidebooks.id — NOT NULL
- member_id — BIGINT — Foreign key → members.id — NOT NULL
- status — VARCHAR(20) — NOT NULL
- prompt_dismissed_at — DATETIME(6)
- submitted_at — DATETIME(6)
- created_at — DATETIME(6) — NOT NULL
- updated_at — DATETIME(6) — NOT NULL
guidebooks
- id — VARCHAR(50) — Primary key — NOT NULL
- title — VARCHAR(15) — NOT NULL
- region_id — BIGINT — Foreign key → regions.id — NOT NULL
- start_date — DATE — NOT NULL
- end_date — DATE — NOT NULL
- companion — VARCHAR(20) — NOT NULL
- people_count — INT — NOT NULL
- content_html — TEXT
- version — INT — NOT NULL
- created_at — DATETIME(6) — NOT NULL
- updated_at — DATETIME(6) — NOT NULL
itinerary_days
- id — BIGINT — Primary key — NOT NULL
- guidebook_id — VARCHAR(50) — Foreign key → guidebooks.id — NOT NULL
- day_number — SMALLINT — NOT NULL
- itinerary_date — DATE — NOT NULL
itinerary_items
- id — BIGINT — Primary key — NOT NULL
- itinerary_day_id — BIGINT — Foreign key → itinerary_days.id — NOT NULL
- tourism_content_id — BIGINT — Foreign key → tourism_contents.id
- sequence — SMALLINT — NOT NULL
- scheduled_time — TIME
- place_snapshot — JSON — NOT NULL
- created_at — DATETIME(6) — NOT NULL
member_guidebooks
- id — BIGINT — Primary key — NOT NULL
- member_id — BIGINT — Foreign key → members.id — NOT NULL
- guidebook_id — VARCHAR(50) — Foreign key → guidebooks.id — NOT NULL
- acquisition_type — VARCHAR(20) — NOT NULL
- created_at — DATETIME(6) — NOT NULL
- deleted_at — DATETIME(6)
member_preferences
- id — BIGINT — Primary key — NOT NULL
- member_id — BIGINT — Foreign key → members.id — NOT NULL
- preference_type — VARCHAR(20) — NOT NULL
- preference_code — VARCHAR(50) — NOT NULL
members
- id — BIGINT — Primary key — NOT NULL
- oauth_provider — VARCHAR(20) — NOT NULL
- oauth_subject — VARCHAR(255) — NOT NULL
- nickname — VARCHAR(50) — NOT NULL
- profile_image_url — VARCHAR(2048)
- language_code — VARCHAR(10) — NOT NULL
- status — VARCHAR(20) — NOT NULL
- push_enabled — BOOLEAN — NOT NULL
- deleted_at — DATETIME(6)
- created_at — DATETIME(6) — NOT NULL
- updated_at — DATETIME(6) — NOT NULL
notifications
- id — BIGINT — Primary key — NOT NULL
- recipient_member_id — BIGINT — Foreign key → members.id — NOT NULL
- type — VARCHAR(30) — NOT NULL
- title — VARCHAR(100) — NOT NULL
- body — VARCHAR(500) — NOT NULL
- reference_type — VARCHAR(30)
- reference_id — VARCHAR(50)
- created_at — DATETIME(6) — NOT NULL
orders
- id — BIGINT — Primary key — NOT NULL
- merchant_order_id — VARCHAR(100) — NOT NULL
- member_id — BIGINT — Foreign key → members.id — NOT NULL
- product_id — BIGINT — Foreign key → credit_products.id — NOT NULL
- ordered_credit_amount — INT — NOT NULL
- total_amount — BIGINT — NOT NULL
- currency — CHAR(3) — NOT NULL
- status — VARCHAR(20) — NOT NULL
- idempotency_key — VARCHAR(100) — NOT NULL
- paid_at — DATETIME(6)
- cancelled_at — DATETIME(6)
- created_at — DATETIME(6) — NOT NULL
- updated_at — DATETIME(6) — NOT NULL
payment_attempts
- id — BIGINT — Primary key — NOT NULL
- order_id — BIGINT — Foreign key → orders.id — NOT NULL
- pg_provider — VARCHAR(30) — NOT NULL
- pg_transaction_id — VARCHAR(150)
- status — VARCHAR(20) — NOT NULL
- requested_amount — BIGINT — NOT NULL
- approved_amount — BIGINT
- failure_code — VARCHAR(100)
- failure_message — VARCHAR(500)
- requested_at — DATETIME(6) — NOT NULL
- approved_at — DATETIME(6)
- failed_at — DATETIME(6)
- created_at — DATETIME(6) — NOT NULL
- updated_at — DATETIME(6) — NOT NULL
place_ratings
- id — BIGINT — Primary key — NOT NULL
- member_id — BIGINT — Foreign key → members.id — NOT NULL
- tourism_content_id — BIGINT — Foreign key → tourism_contents.id — NOT NULL
- score — SMALLINT
- created_at — DATETIME(6) — NOT NULL
- updated_at — DATETIME(6) — NOT NULL
ranking_entries
- id — BIGINT — Primary key — NOT NULL
- ranking_snapshot_id — BIGINT — Foreign key → ranking_snapshots.id — NOT NULL
- content_id — BIGINT — Foreign key → tourism_contents.id — NOT NULL
- rank_position — INT — NOT NULL
- weighted_score — DECIMAL(8, 5) — NOT NULL
- raw_average — DECIMAL(3, 2) — NOT NULL
- rating_count — INT — NOT NULL
- created_at — DATETIME(6) — NOT NULL
ranking_snapshots
- id — BIGINT — Primary key — NOT NULL
- period_type — VARCHAR(20) — NOT NULL
- period_start — DATE — NOT NULL
- period_end — DATE — NOT NULL
- region_id — BIGINT — Foreign key → regions.id
- scope_region_id — BIGINT
- calculated_at — DATETIME(6) — NOT NULL
regions
- id — BIGINT — Primary key — NOT NULL
- administrative_code — VARCHAR(20) — NOT NULL
- name — VARCHAR(100) — NOT NULL
share_links
- id — BIGINT — Primary key — NOT NULL
- guidebook_id — VARCHAR(50) — Foreign key → guidebooks.id — NOT NULL
- issued_by_member_id — BIGINT — Foreign key → members.id — NOT NULL
- token_hash — VARCHAR(255) — NOT NULL
- expires_at — DATETIME(6)
- created_at — DATETIME(6) — NOT NULL
tourism_contents
- id — BIGINT — Primary key — NOT NULL
- category — VARCHAR(30) — NOT NULL
- source_provider — VARCHAR(30) — NOT NULL
- source_content_id — VARCHAR(100) — NOT NULL
- title — VARCHAR(200) — NOT NULL
- description — TEXT
- region_id — BIGINT — Foreign key → regions.id — NOT NULL
- address — VARCHAR(500)
- location — POINT — NOT NULL
- phone — VARCHAR(50)
- homepage_url — VARCHAR(2048)
- thumbnail_url — VARCHAR(2048)
- status — VARCHAR(20) — NOT NULL
- deleted_at — DATETIME(6)
- created_at — DATETIME(6) — NOT NULL
- updated_at — DATETIME(6) — NOT NULL