Re: DB Layout

[email protected] (Dave Rolsky) Thu, 31 Jan 2002 17:00:58 -0600 (CST)
Newsgroups perl.books.workers
Message-ID <[email protected]>
On Thu, 31 Jan 2002, Uri Guttman wrote:

>   DR>   Role
>   DR>   ----------
>   DR>   role_id
>   DR>   role -- editor, author, ...
>
> do we need to id roles?

You mean as opposed to simply having a text field in the BookPerson table?
I'd prefer to have the separate Role table for standardization.

> i don't agree as we want to list reviews separately from other book
> links. maybe a link_type that says what kind of link: cover, home page,
> review, etc. then we can grab all the review links and our text review
> entries and make one listing of reviews.

You're confusing the schema with the UI.  In the UI, we will certainly
make a point of grouping 'internal' (in the DB) reviews and external
(links) reviews.  And those links will be separate from links to cover
pages, table of contents, sample chapters, etc.

But that doesn't require that the Review table have a link column.

> we haven't covered ratings either. a new table with user_id, book_id and
> rating? we can keep the running average in the book table itself to make

There was a UserBookRating table in my original schema.

> it easy to sort by ratings. also we would want a user to be able to
> filter out foe ratings as well as reviews. who would want a dummy's votes to
> matter?

We can do that, though it does end up requiring more selects on the DB
(but that's probably ok).

I was thinking we'd offer user's the ability to configure how that's
handled, something like:

 Friends' book ratings are given:

 - 3x weighting
 - 2x weighting
 - 1.5x weighting
 - 1.1x weighting
 - normal weighting

 Foes' book ratings are given:

 - normal weighting
 - 0.9x weighting
 - 0.5x weighting
 - 0.1x weighting
 - the cold shoulder


-dave

/*==================
www.urth.org
we await the New Sun
==================*/