Feedback system like Ebay but for events: DB schema
I'm creating a feedback system kind of like eBay. (Once you buy the item you can then leave feedback upon its purchase)
But instead of products its events (partys, meetings). Users can attend the event and then only the users that confirmed their attendance can leave feedback once the event is finished (known by an event_over boolean).
I'm wondering what the best way to create the rows and allow users to give feedback. When a user clicks attending a new Event_RSVP row is made.
Should I also at the same time make a feedback row for users 开发者_开发问答that clicked "attending" (they can change there RSVP status at anytime leading upon the event). But only allow access to the feedback when the event is over?
Or should I create hundreds of feedback rows at once, when the event ends for all the users that attended it? Then allow them to use the feedback
current schema
Event Event_RSVP Feedback
------ ----------- -----------
id id id
user_id user_id user_id
event_over event_id event_id
rsvp_status message
Any opinions or suggestions?
As far as feedback, I'd go with KISS - insert a new row in "Feedback" table only when actual feedback is populated. No need to pre-populate rows.
Another option is to simply move feedback's "message" field back into "Event_RSVP" table; and update that field upon feedback. The downside here is that you can't have multiple messages within the same feedback if you decide you need that, whereas the separate feedback table can be much easier to change to accomodate multiple messages per feedback.
Also, independently of feedback, I'd drop the user_id from the event if that was an attendee ID (if it was origanizer ID, I apologize and leave it in). Events should not contain lists of users. If you want to track who the invite was sent to, either create a new "Invites" table (event_id, user_id) or better yet simply track the invites via RSVP table, by inserting a new row upon the invite being sent and the update "rsvp_status" when user actually RSVPs.
精彩评论