cbrulak
cbrulak

Reputation: 15639

manage multiple reputation in database & code

Trying to implement a rating system of users and postings.

What is the best schema for managing the multiple reputations.

A user has a reputation derived from postings and feedback(similar to SO).

Postings have a reputation too (again similar to SO).

My initial idea as to have one reputation table. The rows would correspond to the id of the user/posting and the value of the vote.

Two Questions:

Thanks

Upvotes: 1

Views: 137

Answers (1)

Gavin H
Gavin H

Reputation: 10492

I would have separate tables for the post reputation and user reputations. These are semantically different things and should be separated as such.

This way you can have one table which has a foreign key to the post, and the other with a foreign key to the user for which the reputation is applicable.

Upvotes: 4

Related Questions