Theoretical design of the contribution table - bounswe/bounswe2015group5 GitHub Wiki

Contribution table

Contribution table shall have following fields:

  • id: A unique key for indexing purposes
  • user id: A foreign key indicating the user that created this contribution
  • title: Given title of the contribution
  • content: The content of the contribution
  • type : A foreign key indicating the type of contribution this record contains
  • date: The date this contribution is created.

Contribution Type table

A content must have exactly one type. Since these types are reoccuring, it is better to keep their descriptions on a seperate table to prevent redundancy.

The contribution type table shall have the following fields:

  • id: A unique key for indexing purposes
  • description : A string describing this type.

Contibution-Tag table

A contibution may have several tags. So we will have a separate table for those.

Contibution-Tag table shall have following fields:

  • contribution id: Foreign key from contribution table.
  • tag id: Foreign key from tag table.

Example

Note that these are symbolic representations of the tables.

Contribution table

id user id title content type date
1 2 Flaw in the internet privacy law's 23th article I found following flaw in the 23th article: Consider the situation where... 4 13/09/2011
2 1 A resourceful paper on the motorcycle shootings' forensics www.example.com/moto-shoo-fore.pdf 1 24/10/2012

Contribution Type table

id description
1 URL
2 Video
3 Picture
4 Writing

Contibution-Tag table

contribution id tag id
1 73
2 12
2 190
1 762

In not-yet-implemented tag table those tag ids may correspond to following topics. 73: forensic medicine 12: political theory 190: polish justice system 762: Jean-Paul Sartre