MarkUs Blog

MarkUs Developers Blog About Their Project

Notes model

with 8 comments

This is the model that we are planning to use for the notes system.

We are going to relate the notes to the users that created them and for the groupings that they are assigned to.

Since we are focusing first on doing notes only for groupings the type column won’t be used, but if time permits we will use it to be able to add notes on submissions or assignments.

Depending on what we decide on foreign keys, we will have to add indexes for user_id and groupings_id to increase performance.

Notes DB

Written by fgarces

November 4th, 2009 at 3:23 pm

Posted in Uncategorized

8 Responses to 'Notes model'

Subscribe to comments with RSS or TrackBack to 'Notes model'.

  1. Looks good!

    One question: It seems user_id and grouping_id are “not null”. If so, what goes into user_id if I attach a note to a grouping? If these two are “nullable” there is no question 🙂



    4 Nov 09 at 9:46 pm

  2. oh yeah, i forgot to mention that, everything is not nullable


    4 Nov 09 at 11:01 pm

  3. Fernando, so if these attributes are *not* null, what happens in the following case:

    I want to attach a note to a particular grouping. In the grouping_id field goes the grouping id. But what goes into user_id? Shouldn’t grouping_id, user_id and be *nullable* and provide means in the application to check that at least one of grouping_id (i.e. group) and user_id are provided?


    5 Nov 09 at 2:09 pm

  4. The user_id is the person who created the note, and the grouping_id is to which group the note is attached to. With the field type we are going to be able to differentiate between assignments or submissions


    5 Nov 09 at 2:21 pm

  5. Ah! Ok, so user_id is the creator of the note. That was not clear to me, sorry. Makes sense, though.


    5 Nov 09 at 6:35 pm

  6. I am torn between user_id and creator_id to be clear between what the role the user is playing exactly, since in the future, we may be able to leave notes on students, which are users…

    Tara Clark

    5 Nov 09 at 10:01 pm

  7. Tara, I agree. Probably it would make more sense to call the attribute creator_id, since it will be more clear for future developers. Also, it’ll result in clearer code? Don’t you think?


    5 Nov 09 at 10:17 pm

  8. I like creator_id too.


    6 Nov 09 at 11:18 am

Leave a Reply