Design Docs Feedback: MVP list and Schema
Opened this issue · 1 comments
RosemaryGonzaga commented
DESIGN DOCS FEEDBACK - MVP list:
- General
- Adjust timeline to end 12/20 - you have a bit more time to complete your 7 MVPs, so add extra time to the features you think will be most complicated.
- Likes
- Likes can belong to more than one type of resource: Images and Comments. I would add another bullet point to this feature:
- Users can like and unlike comments.
- Likes can belong to more than one type of resource: Images and Comments. I would add another bullet point to this feature:
- Follows
- Users can also unfollow other users
DESIGN DOCS FEEDBACK - Database Schema:
- Users
- The bio column should be optional (remove the not null constraint)
- Add an optional name column
- Add an index and uniqueness constraint on the email column
- Likes
- Likes can belong to more than one type of resource: Images and Comments. This will
involve polymorphic associations.- To implement this, you need likeable_type and likeable_id columns
- For more info, check out this guide: https://guides.rubyonrails.org/association_basics.html#polymorphic-associations
- Likes can belong to more than one type of resource: Images and Comments. This will
- Followings
- I would change the foreign keys to something more semantic, like :follower_id and :followee_id. (What you have is not incorrect, but this change will help you as a you develop the project. Because both of those foreign keys point to a user, naming them this way will help you keep track of the relationship between the users, as opposed to naming one the user_id and the other the following_id.)
- Add an index on the followings table to make the combination of [:follower_id, :following_id] unique. (This will ensure that one user can’t follow another user if they’re already following that user. I.e., there should only be one row in the Followings table that represents the link between a follower and a followee.)
- For additional guidance, you can reference:
- this Stack Overflow post: https://stackoverflow.com/questions/6169996/index-on-multiple-columns-in-ruby-on-rails
- and also this old project from the Rails curriculum for guidance: https://open.appacademy.io/learn/swe-in-person-nyc/rails/art-share-api
- For additional guidance, you can reference:
RosemaryGonzaga commented
Hey Jean! Really great work with your design docs so far! I've left feedback on the MVP list and the schema; I'll send additional feedback on your remaining design docs by tomorrow. Let me know if you have questions, and keep up the great work! :)