PostgreSQL · Prisma · ERD
Seven tables, four enum types, UUID primary keys throughout. Designed for a tutor-student marketplace with bookings, availability, and a review system.
user has one tutor_profile — enforced by
userId @unique.
tutor_profile has many availability slots. Weekly
recurring schedule.
tutor_profile and category linked through
tutor_category junction table.
user (as student) has many booking rows.
tutor_profile has many booking rows.
booking has at most one review — enforced by
bookingId @unique on review.
user (as student) has many review rows.
tutor_profile has many review rows.
rating and totalReviews are denormalised for fast reads.