1
Tables (14)
accommodation_amenities
- accommodation_id — BIGINT — Foreign key → accommodations.accommodation_id — NOT NULL
- amenity_id — BIGINT — Foreign key → amenities.amenity_id — NOT NULL
accommodation_images
- image_id — BIGINT — Primary key — NOT NULL
- accommodation_id — BIGINT — Foreign key → accommodations.accommodation_id — NOT NULL
- image_url — VARCHAR(255) — NOT NULL
- is_main — TINYINT(1) — NOT NULL
- sort_order — INT
- created_at — DATETIME — NOT NULL
accommodations
- accommodation_id — BIGINT — Primary key — NOT NULL
- host_id — BIGINT — Foreign key → host_profiles.host_id — NOT NULL
- name — VARCHAR(100) — NOT NULL
- description — TEXT
- type — VARCHAR(30) — NOT NULL
- is_pet_only — TINYINT(1) — NOT NULL
- address — VARCHAR(255) — NOT NULL
- region_code — VARCHAR(20) — Foreign key → region.region_code
- latitude — DOUBLE
- longitude — DOUBLE
- base_price — INT
- max_guests — INT
- max_pets — INT
- checkin_time — TIME
- checkout_time — TIME
- status — VARCHAR(20) — NOT NULL
- created_at — DATETIME — NOT NULL
- updated_at — DATETIME
amenities
- amenity_id — BIGINT — Primary key — NOT NULL
- name — VARCHAR(100) — NOT NULL
- category — VARCHAR(30)
- icon — VARCHAR(100)
bookings
- booking_id — BIGINT — Primary key — NOT NULL
- user_id — BIGINT — Foreign key → users.user_id — NOT NULL
- room_id — BIGINT — Foreign key → rooms.room_id — NOT NULL
- checkin_date — DATE — NOT NULL
- checkout_date — DATE — NOT NULL
- guest_count — INT — NOT NULL
- pet_count — INT — NOT NULL
- total_price — INT — NOT NULL
- status — VARCHAR(20) — NOT NULL
- created_at — DATETIME — NOT NULL
- cancelled_at — DATETIME
favorites
- user_id — BIGINT — Foreign key → users.user_id — NOT NULL
- accommodation_id — BIGINT — Foreign key → accommodations.accommodation_id — NOT NULL
- created_at — DATETIME — NOT NULL
host_profiles
- host_id — BIGINT — Primary key — NOT NULL
- user_id — BIGINT — Foreign key → users.user_id — NOT NULL
- business_name — VARCHAR(100) — NOT NULL
- description — TEXT
- is_verified — TINYINT(1) — NOT NULL
- created_at — DATETIME — NOT NULL
payments
- payment_id — BIGINT — Primary key — NOT NULL
- booking_id — BIGINT — Foreign key → bookings.booking_id — NOT NULL
- amount — INT — NOT NULL
- method — VARCHAR(30) — NOT NULL
- status — VARCHAR(20) — NOT NULL
- paid_at — DATETIME
pet_policies
- policy_id — BIGINT — Primary key — NOT NULL
- accommodation_id — BIGINT — Foreign key → accommodations.accommodation_id — NOT NULL
- allowed_types — VARCHAR(100)
- max_weight_kg — DOUBLE
- extra_fee — INT
- extra_fee_unit — VARCHAR(30)
- note — TEXT
pets
- pet_id — BIGINT — Primary key — NOT NULL
- user_id — BIGINT — Foreign key → users.user_id — NOT NULL
- name — VARCHAR(50) — NOT NULL
- type — VARCHAR(30) — NOT NULL
- breed — VARCHAR(50)
- weight_kg — DOUBLE
- size — VARCHAR(20)
- is_neutered — TINYINT(1)
- is_vaccinated — TINYINT(1)
- birth_date — DATE
- created_at — DATETIME — NOT NULL
region
- region_code — VARCHAR(20) — Primary key — NOT NULL
- name — VARCHAR(100) — NOT NULL
- parent_code — VARCHAR(20)
- depth — INT
reviews
- review_id — BIGINT — Primary key — NOT NULL
- booking_id — BIGINT — Foreign key → bookings.booking_id — NOT NULL
- user_id — BIGINT — Foreign key → users.user_id — NOT NULL
- accommodation_id — BIGINT — Foreign key → accommodations.accommodation_id — NOT NULL
- rating_overall — INT — NOT NULL
- rating_clean — INT
- rating_location — INT
- rating_pet_friendly — INT
- content — TEXT
- created_at — DATETIME — NOT NULL
rooms
- room_id — BIGINT — Primary key — NOT NULL
- accommodation_id — BIGINT — Foreign key → accommodations.accommodation_id — NOT NULL
- name — VARCHAR(100) — NOT NULL
- description — TEXT
- base_price — INT
- max_guests — INT
- max_pets — INT
- area_m2 — INT
- is_active — TINYINT(1) — NOT NULL
- created_at — DATETIME — NOT NULL
users
- user_id — BIGINT — Primary key — NOT NULL
- email — VARCHAR(100) — NOT NULL
- password — VARCHAR(255) — NOT NULL
- name — VARCHAR(50) — NOT NULL
- phone — VARCHAR(20)
- role — VARCHAR(20) — NOT NULL
- created_at — DATETIME — NOT NULL
- updated_at — DATETIME