Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get DB Schema Setup #1

Open
maclover7 opened this issue Sep 4, 2015 · 5 comments
Open

Get DB Schema Setup #1

maclover7 opened this issue Sep 4, 2015 · 5 comments
Assignees

Comments

@maclover7
Copy link
Contributor

Need to plan out how to store data in the DB. Must be done before anything else

@maclover7 maclover7 self-assigned this Sep 4, 2015
@eric-johnson
Copy link
Contributor

Any new thoughts on this?

  • Busses (or Trips, Routes)
    • passenger_limit
    • has_many :passengers
  • Passengers
    • name

Is this an agreeable first step? As you said, it's hard to do anything else without this.

@maclover7
Copy link
Contributor Author

Thanks for this! I think we're going to need a join/intermediary table between trips and passengers. (In case a user wants to on more than one trip) How does this look:

  • Trip
    • description:text
    • name:string
    • passenger_limit:integer
    • belongs_to :host, class_name: User
    • has_many :reservations
    • has_many :users, through: :reservations
  • Reservation
    • trip_id:integer
    • user_id:integer
    • belongs_to :trip
    • belongs_to :user
  • User
    • name:string
    • has_many :reservations
    • has_many :trips, through: :reservations
    • has_many :trips_organized, foreign_key: :host_id, class_name: Trip

@eric-johnson
Copy link
Contributor

We're also going to have organizers/hosts. That would probably be just a host attribute on each trip.

@maclover7
Copy link
Contributor Author

updated schema comment above

@jasnow
Copy link
Contributor

jasnow commented Mar 10, 2016

@maclover7 - Is this issue done?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants