Skip to content

4.3. Database Design

Joey edited this page Apr 18, 2017 · 4 revisions

Entity Relationship Diagram

1. Users

Users are created when a new user logs in via IVLE. Users have a many-to-many relationship with Avatars and Tutorials.

2. Tutorials

Tutorials are created when a user's tutorials are synced with IVLE. While the primary key of the table is a tutorial's id, tutorials can also be uniquely identified with the combination of the tutorial course code and name. Tutorials have a many-to-many relationship with Users.

3. Avatars

Avatars are populated from a JSON file at the point of database migration, and should not be created, updated or destroyed by user actions. Avatars have a many-to-many relationship with Users.

4. UserTutorials

The join table of Users and Tutorials. The join table contains additional columns -- role, which specified if the user is a tutor or a student of the tutorial, and exp, which is the value of experience points accrued by the user in that tutorial.

5. UserAvatars

The join table of Users and Avatars.