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
  • iknow-api/Data/AppDbContext.cs

    r1b20b22 r20df1a3  
    290290                e.HasKey(p => p.Id);
    291291                e.Property(p => p.Id).HasColumnName("id");
    292                 e.Property(p => p.UserId).HasColumnName("user_id");
    293292                e.Property(p => p.EnrollmentInfoId).HasColumnName("enrollment_id");
    294293                e.Property(p => p.Amount).HasColumnName("amount");
    295294
    296                 e.HasOne(p => p.User)
    297                  .WithMany(u => u.Payments)
    298                  .HasForeignKey(p => p.UserId)
    299                  .OnDelete(DeleteBehavior.Cascade);
    300 
     295                // No user_id: the student comes from the enrolment. Removing it
     296                // was the BCNF fix from Phase 5 (enrolled_id -> user_id).
    301297                e.HasOne(p => p.EnrolledSemesters)
    302298                 .WithMany(es => es.Users)
Note: See TracChangeset for help on using the changeset viewer.