Domain Model Discussion #### Chat App - User - Conversation - Message #### Blog - User - Post - Comment #### Appointment Tracker - User - username **TEXT** *required unique* - Appointment - starts_at **DATETIME** *required* - ends_at **DATETIME** *required* - user_id **INTEGER FOREIGN KEY** *required* - location_id **INTEGER FOREIGN KEY** *required* - Location - name **TEXT** *required* - address **TEXT** *required* ### Relationships - User - Appointment (one-to-many) - User has many appointments (one-to-many) - Appointment belongs to user (one-to-one) - User - Location (many-to-many) - User has many locations, through appointments (one-to-many) - Location has many users, through appointments (one-to-many) - Appointment - Location (one-to-many) - Appointment belongs to location (one-to-one) - Location has many appointments (one-to-many) #### Store - Customer - Order - Product #### Music Library - Song - Artist - Genre - SongGenre? (If we want to allow songs to have more than one genre) For this exercise, you'll want to fill in any columns you think might be useful for this domain, which table they'll go in and what their type will be. As you go through the list of models, consider the following questions and keep notes of your answers in this document. - What does a valid row in the table represent? - Which columns are required? - Do any columns have a set of valid values they must match? - Must any of the columns have only unique values? - Which tables required foreign keys and what should they be called? An example might look something like this: ### Twitter - User - username **TEXT** *required* *unique* - Tweet - message **TEXT** *required* - posted_at **DATETIME** *required* - user_id **INTEGER FOREIGN KEY** *required* - Like - tweet_id **INTEGER FOREIGN KEY** *required* - user_id **INTEGER FOREIGN KEY** *required*