11

Tables (40)

amenities

  • id — varchar(36) — Primary key — NOT NULL
  • code — varchar(50) — NOT NULL
  • name — varchar(100) — NOT NULL
  • icon_url — text
  • created_at — timestamp — NOT NULL

booking_holds

  • id — varchar(36) — Primary key — NOT NULL
  • user_id — varchar(36) — Foreign key → users.id — NOT NULL
  • slot_id — varchar(36) — Foreign key → product_slots.id — NOT NULL
  • qty — int — NOT NULL
  • status — varchar(30) — NOT NULL
  • expires_at — timestamp — NOT NULL
  • created_at — timestamp — NOT NULL
  • updated_at — timestamp — NOT NULL

booking_options

  • id — varchar(36) — Primary key — NOT NULL
  • booking_id — varchar(36) — Foreign key → bookings.id — NOT NULL
  • option_id — varchar(36) — Foreign key → product_options.id
  • option_name — varchar(100) — NOT NULL
  • unit_price — int — NOT NULL
  • quantity — int — NOT NULL
  • total_price — int — NOT NULL
  • created_at — timestamp — NOT NULL

bookings

  • id — varchar(36) — Primary key — NOT NULL
  • booking_no — varchar(50) — NOT NULL
  • user_id — varchar(36) — Foreign key → users.id — NOT NULL
  • place_id — varchar(36) — Foreign key → places.id — NOT NULL
  • product_id — varchar(36) — Foreign key → place_products.id — NOT NULL
  • slot_id — varchar(36) — Foreign key → product_slots.id — NOT NULL
  • hold_id — varchar(36) — Foreign key → booking_holds.id
  • status — varchar(30) — NOT NULL
  • reserved_name — varchar(50) — NOT NULL
  • reserved_phone_encrypted — text — NOT NULL
  • reserved_phone_hash — varchar(128) — NOT NULL
  • start_at — timestamp — NOT NULL
  • end_at — timestamp — NOT NULL
  • base_amount — int — NOT NULL
  • option_amount — int — NOT NULL
  • discount_amount — int — NOT NULL
  • total_amount — int — NOT NULL
  • refund_policy_snapshot — text — NOT NULL
  • product_snapshot — text — NOT NULL
  • place_snapshot — text — NOT NULL
  • idempotency_key — varchar(255)
  • confirmed_at — timestamp
  • cancelled_at — timestamp
  • completed_at — timestamp
  • expires_at — timestamp
  • created_at — timestamp — NOT NULL
  • updated_at — timestamp — NOT NULL
  • deleted_at — timestamp

course_places

  • id — varchar(36) — Primary key — NOT NULL
  • course_id — varchar(36) — Foreign key → courses.id — NOT NULL
  • place_id — varchar(36) — Foreign key → places.id — NOT NULL
  • sort_order — int — NOT NULL
  • memo — varchar(255)
  • estimated_stay_minutes — int

courses

  • id — varchar(36) — Primary key — NOT NULL
  • title — varchar(150) — NOT NULL
  • summary — varchar(255)
  • description — text
  • thumbnail_url — text
  • estimated_minutes — int
  • distance_km — decimal(5,2)
  • status — varchar(30) — NOT NULL
  • created_at — timestamp — NOT NULL
  • updated_at — timestamp — NOT NULL
  • deleted_at — timestamp

food_details

  • id — varchar(36) — Primary key — NOT NULL
  • place_id — varchar(36) — Foreign key → places.id — NOT NULL
  • has_dog_seat — tinyint(1)
  • dog_allowed_area — varchar(50)
  • has_dog_menu — tinyint(1)
  • reservation_required — tinyint(1)
  • notes — text

home_section_items

  • id — varchar(36) — Primary key — NOT NULL
  • section_id — varchar(36) — Foreign key → home_sections.id — NOT NULL
  • item_type — varchar(30) — NOT NULL
  • item_id — varchar(36) — NOT NULL
  • display_order — int — NOT NULL
  • starts_at — timestamp
  • ends_at — timestamp
  • created_at — timestamp — NOT NULL

home_sections

  • id — varchar(36) — Primary key — NOT NULL
  • section_key — varchar(100) — NOT NULL
  • title — varchar(100) — NOT NULL
  • subtitle — varchar(255)
  • display_order — int — NOT NULL
  • is_active — tinyint(1) — NOT NULL
  • created_at — timestamp — NOT NULL
  • updated_at — timestamp — NOT NULL

hosts

  • id — varchar(36) — Primary key — NOT NULL
  • business_name — varchar(100) — NOT NULL
  • owner_name — varchar(50)
  • phone_encrypted — text
  • phone_hash — varchar(128)
  • email — varchar(255)
  • status — varchar(30) — NOT NULL
  • created_at — timestamp — NOT NULL
  • updated_at — timestamp — NOT NULL

inquiries

  • id — varchar(36) — Primary key — NOT NULL
  • user_id — varchar(36) — Foreign key → users.id — NOT NULL
  • category — varchar(50) — NOT NULL
  • title — varchar(150) — NOT NULL
  • content — text — NOT NULL
  • status — varchar(30) — NOT NULL
  • created_at — timestamp — NOT NULL
  • updated_at — timestamp — NOT NULL
  • deleted_at — timestamp

notification_jobs

  • id — varchar(36) — Primary key — NOT NULL
  • user_id — varchar(36) — Foreign key → users.id — NOT NULL
  • booking_id — varchar(36) — Foreign key → bookings.id
  • type — varchar(50) — NOT NULL
  • channel — varchar(30) — NOT NULL
  • title — varchar(255) — NOT NULL
  • body — text — NOT NULL
  • payload — text
  • scheduled_at — timestamp — NOT NULL
  • sent_at — timestamp
  • failed_at — timestamp
  • status — varchar(30) — NOT NULL
  • created_at — timestamp — NOT NULL
  • updated_at — timestamp — NOT NULL

outbox_events

  • id — varchar(36) — Primary key — NOT NULL
  • aggregate_type — varchar(50) — NOT NULL
  • aggregate_id — varchar(36) — NOT NULL
  • event_type — varchar(100) — NOT NULL
  • payload — text — NOT NULL
  • status — varchar(30) — NOT NULL
  • attempts — int — NOT NULL
  • next_attempt_at — timestamp
  • published_at — timestamp
  • created_at — timestamp — NOT NULL
  • updated_at — timestamp — NOT NULL

outdoor_details

  • id — varchar(36) — Primary key — NOT NULL
  • place_id — varchar(36) — Foreign key → places.id — NOT NULL
  • difficulty — varchar(30)
  • distance_km — decimal(5,2)
  • estimated_minutes — int
  • allowed_dog_size — varchar(30)
  • notes — text

password_reset_tokens

  • id — varchar(36) — Primary key — NOT NULL
  • user_id — varchar(36) — Foreign key → users.id — NOT NULL
  • token_hash — varchar(255) — NOT NULL
  • expires_at — timestamp — NOT NULL
  • used_at — timestamp
  • requested_ip — varchar(100)
  • created_at — timestamp — NOT NULL

payment_audit_logs

  • id — varchar(36) — Primary key — NOT NULL
  • booking_id — varchar(36) — Foreign key → bookings.id
  • payment_id — varchar(36) — Foreign key → payments.id
  • provider — varchar(30) — NOT NULL
  • action — varchar(50) — NOT NULL
  • amount — int
  • event_id — varchar(255)
  • order_id — varchar(100)
  • status — varchar(30) — NOT NULL
  • reason — varchar(255)
  • payload — text
  • created_at — timestamp — NOT NULL

payment_events

  • id — varchar(36) — Primary key — NOT NULL
  • provider — varchar(30) — NOT NULL
  • event_id — varchar(255)
  • order_id — varchar(100)
  • pg_transaction_id — varchar(255)
  • event_type — varchar(100) — NOT NULL
  • payload — text — NOT NULL
  • processed_at — timestamp
  • created_at — timestamp — NOT NULL

payments

  • id — varchar(36) — Primary key — NOT NULL
  • booking_id — varchar(36) — Foreign key → bookings.id — NOT NULL
  • provider — varchar(30) — NOT NULL
  • method — varchar(30) — NOT NULL
  • order_id — varchar(100) — NOT NULL
  • pg_transaction_id — varchar(255)
  • amount — int — NOT NULL
  • status — varchar(30) — NOT NULL
  • requested_at — timestamp — NOT NULL
  • paid_at — timestamp
  • failed_at — timestamp
  • cancelled_at — timestamp
  • receipt_url — text
  • raw_response — text
  • created_at — timestamp — NOT NULL
  • updated_at — timestamp — NOT NULL

pets

  • id — varchar(36) — Primary key — NOT NULL
  • user_id — varchar(36) — Foreign key → users.id — NOT NULL
  • name — varchar(50) — NOT NULL
  • breed — varchar(100)
  • age_years — int
  • size — varchar(20)
  • sex — varchar(20)
  • is_representative — tinyint(1) — NOT NULL
  • created_at — timestamp — NOT NULL
  • updated_at — timestamp — NOT NULL
  • deleted_at — timestamp

place_amenities

  • id — varchar(36) — Primary key — NOT NULL
  • place_id — varchar(36) — Foreign key → places.id — NOT NULL
  • amenity_id — varchar(36) — Foreign key → amenities.id — NOT NULL

place_business_hours

  • id — varchar(36) — Primary key — NOT NULL
  • place_id — varchar(36) — Foreign key → places.id — NOT NULL
  • day_of_week — int — NOT NULL
  • open_time — time
  • close_time — time
  • is_closed — tinyint(1) — NOT NULL
  • created_at — timestamp — NOT NULL
  • updated_at — timestamp — NOT NULL

place_holidays

  • id — varchar(36) — Primary key — NOT NULL
  • place_id — varchar(36) — Foreign key → places.id — NOT NULL
  • holiday_date — date — NOT NULL
  • reason — varchar(255)
  • created_at — timestamp — NOT NULL

place_images

  • id — varchar(36) — Primary key — NOT NULL
  • place_id — varchar(36) — Foreign key → places.id — NOT NULL
  • image_url — text — NOT NULL
  • sort_order — int — NOT NULL
  • is_representative — tinyint(1) — NOT NULL
  • created_at — timestamp — NOT NULL

place_products

  • id — varchar(36) — Primary key — NOT NULL
  • place_id — varchar(36) — Foreign key → places.id — NOT NULL
  • name — varchar(150) — NOT NULL
  • description — text
  • base_price — int — NOT NULL
  • duration_minutes — int — NOT NULL
  • refund_policy — varchar(30) — NOT NULL
  • base_people_count — int
  • base_dog_count — int
  • max_people_count — int
  • max_dog_count — int
  • status — varchar(30) — NOT NULL
  • display_order — int — NOT NULL
  • created_at — timestamp — NOT NULL
  • updated_at — timestamp — NOT NULL
  • deleted_at — timestamp

places

  • id — varchar(36) — Primary key — NOT NULL
  • host_id — varchar(36) — Foreign key → hosts.id
  • category — varchar(30) — NOT NULL
  • name — varchar(150) — NOT NULL
  • summary — varchar(255)
  • description — text
  • address — varchar(255) — NOT NULL
  • address_detail — varchar(255)
  • region_1depth — varchar(50)
  • region_2depth — varchar(50)
  • latitude — decimal(10,7) — NOT NULL
  • longitude — decimal(10,7) — NOT NULL
  • phone_encrypted — text
  • status — varchar(30) — NOT NULL
  • avg_rating — decimal(3,2) — NOT NULL
  • review_count — int — NOT NULL
  • wish_count — int — NOT NULL
  • view_count — int — NOT NULL
  • created_at — timestamp — NOT NULL
  • updated_at — timestamp — NOT NULL
  • deleted_at — timestamp

product_options

  • id — varchar(36) — Primary key — NOT NULL
  • product_id — varchar(36) — Foreign key → place_products.id — NOT NULL
  • name — varchar(100) — NOT NULL
  • description — text
  • price — int — NOT NULL
  • max_quantity — int — NOT NULL
  • is_active — tinyint(1) — NOT NULL
  • display_order — int — NOT NULL
  • created_at — timestamp — NOT NULL
  • updated_at — timestamp — NOT NULL
  • deleted_at — timestamp

product_slots

  • id — varchar(36) — Primary key — NOT NULL
  • product_id — varchar(36) — Foreign key → place_products.id — NOT NULL
  • place_id — varchar(36) — Foreign key → places.id — NOT NULL
  • service_date — date — NOT NULL
  • start_at — timestamp — NOT NULL
  • end_at — timestamp — NOT NULL
  • capacity — int — NOT NULL
  • confirmed_count — int — NOT NULL
  • held_count — int — NOT NULL
  • status — varchar(30) — NOT NULL
  • close_reason — varchar(255)
  • version — int — NOT NULL
  • created_at — timestamp — NOT NULL
  • updated_at — timestamp — NOT NULL

receipts

  • id — varchar(36) — Primary key — NOT NULL
  • booking_id — varchar(36) — Foreign key → bookings.id — NOT NULL
  • payment_id — varchar(36) — Foreign key → payments.id — NOT NULL
  • receipt_no — varchar(50) — NOT NULL
  • supply_amount — int — NOT NULL
  • vat_amount — int — NOT NULL
  • total_amount — int — NOT NULL
  • payment_method — varchar(30) — NOT NULL
  • issued_at — timestamp — NOT NULL
  • snapshot — text — NOT NULL
  • created_at — timestamp — NOT NULL

recent_searches

  • id — varchar(36) — Primary key — NOT NULL
  • user_id — varchar(36) — Foreign key → users.id — NOT NULL
  • keyword — varchar(255) — NOT NULL
  • searched_at — timestamp — NOT NULL

refresh_tokens

  • id — varchar(36) — Primary key — NOT NULL
  • user_id — varchar(36) — Foreign key → users.id — NOT NULL
  • token_hash — varchar(255) — NOT NULL
  • device_id — varchar(36)
  • expires_at — timestamp — NOT NULL
  • revoked_at — timestamp
  • created_at — timestamp — NOT NULL

refunds

  • id — varchar(36) — Primary key — NOT NULL
  • booking_id — varchar(36) — Foreign key → bookings.id — NOT NULL
  • payment_id — varchar(36) — Foreign key → payments.id — NOT NULL
  • amount — int — NOT NULL
  • reason — varchar(255)
  • status — varchar(30) — NOT NULL
  • refund_policy_snapshot — text — NOT NULL
  • pg_refund_id — varchar(255)
  • requested_at — timestamp — NOT NULL
  • completed_at — timestamp
  • raw_response — text
  • created_at — timestamp — NOT NULL
  • updated_at — timestamp — NOT NULL

review_images

  • id — varchar(36) — Primary key — NOT NULL
  • review_id — varchar(36) — Foreign key → reviews.id — NOT NULL
  • image_url — text — NOT NULL
  • sort_order — int — NOT NULL
  • created_at — timestamp — NOT NULL

reviews

  • id — varchar(36) — Primary key — NOT NULL
  • booking_id — varchar(36) — Foreign key → bookings.id — NOT NULL
  • user_id — varchar(36) — Foreign key → users.id — NOT NULL
  • place_id — varchar(36) — Foreign key → places.id — NOT NULL
  • rating — int — NOT NULL
  • content — text
  • status — varchar(30) — NOT NULL
  • created_at — timestamp — NOT NULL
  • updated_at — timestamp — NOT NULL
  • deleted_at — timestamp

user_devices

  • id — varchar(36) — Primary key — NOT NULL
  • user_id — varchar(36) — Foreign key → users.id — NOT NULL
  • platform — varchar(20) — NOT NULL
  • push_token — text — NOT NULL
  • app_version — varchar(30)
  • device_model — varchar(100)
  • is_active — tinyint(1) — NOT NULL
  • last_seen_at — timestamp
  • created_at — timestamp — NOT NULL
  • updated_at — timestamp — NOT NULL

user_notification_settings

  • id — varchar(36) — Primary key — NOT NULL
  • user_id — varchar(36) — Foreign key → users.id — NOT NULL
  • booking_alert_enabled — tinyint(1) — NOT NULL
  • weather_alert_enabled — tinyint(1) — NOT NULL
  • reminder_enabled — tinyint(1) — NOT NULL
  • marketing_enabled — tinyint(1) — NOT NULL
  • updated_at — timestamp — NOT NULL

user_social_accounts

  • id — varchar(36) — Primary key — NOT NULL
  • user_id — varchar(36) — Foreign key → users.id — NOT NULL
  • provider — varchar(20) — NOT NULL
  • provider_user_id — varchar(255) — NOT NULL
  • provider_email — varchar(255)
  • provider_profile_json — text
  • connected_at — timestamp — NOT NULL
  • created_at — timestamp — NOT NULL

user_wishes

  • id — varchar(36) — Primary key — NOT NULL
  • user_id — varchar(36) — Foreign key → users.id — NOT NULL
  • place_id — varchar(36) — Foreign key → places.id — NOT NULL
  • created_at — timestamp — NOT NULL

users

  • id — varchar(36) — Primary key — NOT NULL
  • email — varchar(255)
  • email_normalized — varchar(255)
  • password_hash — text
  • name — varchar(50) — NOT NULL
  • nickname — varchar(50) — NOT NULL
  • phone_encrypted — text
  • phone_hash — varchar(128)
  • profile_image_url — text
  • signup_type — varchar(30) — NOT NULL
  • status — varchar(30) — NOT NULL
  • last_login_at — timestamp
  • withdrawn_at — timestamp
  • created_at — timestamp — NOT NULL
  • updated_at — timestamp — NOT NULL
  • deleted_at — timestamp

weather_forecasts

  • id — varchar(36) — Primary key — NOT NULL
  • place_id — varchar(36) — Foreign key → places.id — NOT NULL
  • forecast_date — date — NOT NULL
  • weather_code — varchar(50)
  • weather_text — varchar(100)
  • min_temp — decimal(4,1)
  • max_temp — decimal(4,1)
  • precipitation_probability — int
  • source — varchar(50)
  • fetched_at — timestamp — NOT NULL
  • created_at — timestamp — NOT NULL

yard_details

  • id — varchar(36) — Primary key — NOT NULL
  • place_id — varchar(36) — Foreign key → places.id — NOT NULL
  • area_square_meter — int
  • has_fence — tinyint(1)
  • fence_height_cm — int
  • allowed_dog_size — varchar(30)
  • max_dogs — int
  • notes — text