Changeset 20df1a3 for sql/schema.md


Ignore:
Timestamp:
09/16/26 14:48:55 (7 days ago)
Author:
Stefan-Saveski <stefansaveski19@…>
Branches:
master
Children:
f7c8acf
Parents:
1b20b22
Message:

Refactor payment model to remove redundant user_id, addressing BCNF violation in Phase 5 normalization

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sql/schema.md

    r1b20b22 r20df1a3  
    111111    payment {
    112112        integer id PK
    113         integer user_id FK
    114113        integer enrollment_id FK
    115114        integer amount
     
    136135    users               ||--o| contact            : has_contact
    137136    users               ||--o{ token              : has_token
    138     users               ||--o{ payment            : pays
    139137    users               ||--o{ enrolled_semesters : submits
    140138    users               ||--o{ user_documents     : owns
     
    184182  they differ.
    185183- `professour_subjects` keeps the spelling used by the table in `schema_creation.sql`.
     184- `payment` has no `user_id`: the student is reached through `enrollment_id`.
     185  Storing it twice violated BCNF (`enrolled_id -> user_id`) and allowed a
     186  payment to contradict the enrolment it refers to. Removed in Phase 5.
Note: See TracChangeset for help on using the changeset viewer.