Closed seatuna closed 8 years ago
Sure!
A little confused by your notes: "Join stores and drinks, store_id and drink_id" "how do I get store string into drinks?"
If you have two related models, stores and drinks, you should be able to refer to any of the properties of any drink's store by writing someDrink.store.someProperty
I was wondering if I needed to do a join table (to get store_id in the drinks table, and drink_id in the stores table) or will creating associations in AR suffice?
I want my drinks table to have a column labeled "store" that contains the name of the store (ex: Green Milk Tea will have store_name: 'Kung Fu Tea'), should I enter that in myself in the .csv file or should I get that information through using a query and then setting it in SQL?
The only reason you would need a join table is if drinks and stores have a many-to-many relationship (i.e. one drink can appear in many stores, and one store can have many drinks).
Why should a store's name be part of the drinks table? Can't it be on the stores table, and the drink can just refer to a specific store?
Just for completeness sake. I guess it's not completely necessary?
There's no need for it, and it actually doesn't make sense to do it because a store's name is a property of a store.
Ok! Any other feedback about the rest of my planning things?
Your wireframes look good, and your ERD (apart from those points I mentioned) makes sense. Representing things like lists of locations or ingredients as strings makes sense in this context.
Thank you!! :) I shall close this issue now.
Hello! Can I get feedback / advice for my project planning? I'd especially like feedback on my ERD and plan appropriately before I create my database and tables.
Wireframe: https://drive.google.com/file/d/0B35knKRAJGV0QkVORTZBRy02MXM/view?usp=sharing ERD: https://drive.google.com/file/d/0B35knKRAJGV0eTE4b1F6d0dGdGc/view?usp=sharing
fullstack-project-bubbletea.docx
^ Notes and questions are in the word doc