marcusgeorgievski / prj-team-1

Student management system to track assessments and organize notes
https://prj-frontend.vercel.app
3 stars 0 forks source link

ERD #35

Closed lctoye closed 3 months ago

lctoye commented 3 months ago

Entity Relationship Diagram

marcusgeorgievski commented 3 months ago

Created an initial version of the ERD:

users -> classes -> [assessments, notes]

where -> is a 1-to-many relationship.

However, we will need to query assessments many times without classes, so it would be appropriate to added a user_id FK to assessments and notes:

users -> [assessments, notes, classes] classes -> [assessments, notes]

lctoye commented 3 months ago

As per meeting with professor, we should revisit cardinalities on the ERD.

lctoye commented 3 months ago

Added to SRS section 5.1.3

erDiagram
    users ||--o{ classes : manages
    users {
        UUID user_id PK
        TEXT name
        TEXT email
        TEXT password
        TEXT image
        TIMESTAMP created_at
    }

    classes ||--o{ assessments : has
    classes ||--o{ notes : includes
    classes {
        UUID class_id PK
        UUID user_id FK
        TEXT name
        TEXT professor
        TEXT details
        TIMESTAMP created_at
        TIMESTAMP updated_at
    }

    users ||--o{ assessments : creates
    assessments {
        UUID assessment_id PK
        UUID class_id FK
        UUID user_id FK
        TEXT name
        TEXT description
        TEXT status
        NUMBER weight
        TIMESTAMP due_date
        TIMESTAMP created_at
        TIMESTAMP updated_at
    }

    users ||--o{ notes : creates
    notes {
        UUID note_id PK
        UUID class_id FK
        UUID user_id FK
        TEXT name
        TEXT content
        TIMESTAMP created_at
        TIMESTAMP updated_at
    }