[Database] - Fixed ManyToMany relations - #572
Merged
Merged
Conversation
…of some faulty merge
…ly added last commit
brieromb
requested review from
Adrien-VL,
LambrechtMaarten,
bramcomyn and
thomasdejaeghere
May 15, 2025 16:03
brieromb
marked this pull request as ready for review
May 15, 2025 16:16
…ed twice to a class or group
Contributor
|
@brieromb Do we have a tests that checks if it's possible to add a student twice to a class or group. Because we need to be sure that fails. (make combo, userid and classid unique in classtypeorm f.e.) |
Contributor
Author
|
@thomasdejaeghere TypeORM will make a table for this ManyToMany relation with primary key: the combination of a key from each of the 2 tables. So adding a student twice to a group or a class should not be possible, as combinations of group/student are unique. EDIT: wrote a test to confirm this, and adding a student to the same group twice is indeed not possible |
thomasdejaeghere
approved these changes
May 16, 2025
Adrien-VL
approved these changes
May 16, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
removed the explicit userOfClass and studentOfGroup tables. Replaced that by many to many relations in the group and class tables.