REAL Estate

Tables (22)

admin_announcements

  • announcement_id — INT
  • title — VARCHAR(100) — NOT NULL
  • content — TEXT
  • created_at — DATETIME — NOT NULL

admin_logs

  • admin_id — INT — Primary key — NOT NULL
  • log_id — INT
  • log_type — VARCHAR(50)
  • log_content — TEXT
  • created_at — DATETIME — NOT NULL

admin_notifications

  • notification_id — INT
  • admin_id — INT — NOT NULL
  • notification_content — TEXT
  • sent_at — DATETIME — NOT NULL

admin_statistics

  • stat_id — INT
  • stat_name — VARCHAR(100)
  • value — INT
  • recorded_at — DATETIME — NOT NULL

attachments

  • related_id — INT — Primary key — NOT NULL
  • attachment_id — INT
  • related_type — VARCHAR(50)
  • file_path — VARCHAR(200)
  • uploaded_at — DATETIME — NOT NULL

notifications

  • user_id — INT — Primary key — NOT NULL
  • notification_id — INT
  • content — TEXT
  • created_at — DATETIME — NOT NULL

properties

  • status_id (status_id2) — INT — Foreign key → reservations.status_id — NOT NULL
  • property_id — INT — Foreign key → reservations.property_id — NOT NULL
  • property_name — VARCHAR(100) — NOT NULL
  • price — DECIMAL(15, 2) — NOT NULL
  • area — DECIMAL(10, 2)
  • created_at — DATETIME — NOT NULL
  • status_id — INT — NOT NULL
  • type_id — INT — NOT NULL
  • related_id — INT — Foreign key → attachments.related_id — NOT NULL

property_images

  • image_id — INT
  • image_url — VARCHAR(200)

property_inquiries

  • inquiry_id — INT
  • property_id — INT — NOT NULL
  • user_id — INT — NOT NULL
  • inquiry_content — TEXT
  • created_at — DATETIME — NOT NULL

property_reviews

  • property_id — INT — Primary key — NOT NULL
  • user_id — INT — Primary key — NOT NULL
  • review_id — INT
  • rating — INT
  • review_content — TEXT
  • created_at — DATETIME — NOT NULL

property_status

  • status_id — INT
  • status_name — VARCHAR(50) — NOT NULL

property_types

  • type_id — INT
  • type_name — VARCHAR(50) — NOT NULL

property_views

  • property_id — INT — Primary key — NOT NULL
  • user_id — INT — Primary key — NOT NULL
  • view_id — INT
  • viewed_at — DATETIME — NOT NULL

reservation_logs

  • log_id — INT
  • reservation_id — INT — NOT NULL
  • status_id — INT — NOT NULL
  • log_content — TEXT
  • log_date — DATETIME — NOT NULL

reservation_notifications

  • notification_id — INT
  • reservation_id — INT — NOT NULL
  • user_id — INT — NOT NULL
  • notification_content — TEXT
  • sent_at — DATETIME — NOT NULL

reservation_status

  • status_id — INT
  • status_name — VARCHAR(50) — NOT NULL

reservations

  • status_id — INT — Primary key — NOT NULL
  • property_id — INT — Primary key — NOT NULL
  • reservation_id — INT
  • user_id — INT — NOT NULL
  • reserved_at — DATETIME — NOT NULL

user_activity_log

  • user_id (user_id2) — Foreign key → users.user_id — NOT NULL
  • property_id — INT — Foreign key → users.property_id — NOT NULL
  • property_id (property_id2) — INT — Foreign key → users.property_id — NOT NULL
  • Key — Foreign key → users.Key — NOT NULL
  • admin_id — INT — Foreign key → users.admin_id — NOT NULL
  • user_id (user_id22) — INT — Foreign key → users.user_id — NOT NULL
  • log_id — INT
  • user_id — INT — NOT NULL
  • activity_type — VARCHAR(50)
  • log_content — TEXT
  • created_at — DATETIME — NOT NULL

user_profiles

  • user_id — INT — Foreign key → users.user_id — NOT NULL
  • property_id — INT — Foreign key → users.property_id — NOT NULL
  • property_id (property_id2) — INT — Foreign key → users.property_id — NOT NULL
  • Key — Foreign key → users.Key — NOT NULL
  • admin_id — INT — Foreign key → users.admin_id — NOT NULL
  • user_id (user_id2) — INT — Foreign key → users.user_id — NOT NULL
  • profile_id — INT
  • email — VARCHAR(100)
  • phone — VARCHAR(20)
  • address — VARCHAR(200)

user_roles

  • role_id — INT
  • role_name — VARCHAR(50) — NOT NULL

user_wishlist

  • user_id (user_id2) — Foreign key → users.user_id — NOT NULL
  • property_id (property_id2) — INT — Foreign key → users.property_id — NOT NULL
  • property_id (property_id22) — INT — Foreign key → users.property_id — NOT NULL
  • Key — Foreign key → users.Key — NOT NULL
  • admin_id — INT — Foreign key → users.admin_id — NOT NULL
  • user_id (user_id22) — INT — Foreign key → users.user_id — NOT NULL
  • wishlist_id — INT
  • user_id — INT — NOT NULL
  • property_id — INT — NOT NULL

users

  • user_id — Primary key — NOT NULL
  • property_id — INT — Foreign key → property_reviews.property_id — NOT NULL
  • property_id (property_id2) — INT — Foreign key → property_views.property_id — NOT NULL
  • admin_id — INT — Foreign key → admin_logs.admin_id — NOT NULL
  • user_id (user_id2) — INT — Foreign key → notifications.user_id — NOT NULL
  • username — VARCHAR(50) — NOT NULL
  • password — VARCHAR(100) — NOT NULL
  • created_at — DATETIME — NOT NULL
  • status_id — INT — Foreign key → reservations.status_id — NOT NULL
  • Key — Foreign key → reservations.property_id — NOT NULL