The Schema

Six tables, in plain words

db/schema.rb is auto-generated β€” you never hand-edit it, migrations produce it β€” but it's the fastest way to see the whole shape of the app at once. Six tables (a seventh, payments, shows up in module 12):

  • users β€” an account: name, email, password_digest (module 10 explains that column).
  • walkers β€” a dog walker for hire: name, city, price_per_30_min_cents, rating. Nothing links a walker to a user yet β€” walkers aren't users in this app, just listings.
  • dogs β€” belongs to a user: name, breed, size.
  • bookings β€” the hub. It references user, walker, AND dog all at once: a user books a specific dog with a specific walker.
  • walk_sessions β€” one per booking (has_one), tracks started_at/ended_at for the walk actually happening.
  • location_pings β€” many per walk_session, a GPS fix at a moment in time (lat, lng, recorded_at).

In one sentence: users β†’ dogs, and users + walkers + dogs β†’ bookings β†’ walk_sessions β†’ location_pings. Everything downstream of a booking exists because that booking exists.