Module 09 Β· PawWalk Kickoff β Lesson 2 of 5 Β· ~11 min
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 auser:name,breed,size.bookingsβ the hub. It referencesuser,walker, ANDdogall at once: a user books a specific dog with a specific walker.walk_sessionsβ one per booking (has_one), tracksstarted_at/ended_atfor 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.