You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Deleting a character will trigger the foreign key cascade for all cars attached to the license instead of just the cars of the character being deleted.
Reproduction
Have multiple characters with the same license
Give cars to multiple characters
Delete a single character
Lose all of your cars on all characters
Expected behavior
Don't delete cars from other characters that are not being deleted. Just delete the cars of the character that is being deleted.
Actual behavior
All cars of all characters with the same license are deleted because of the cascade delete from the foreign key.
Additional context
I believe removing the foreign key will prevent this from happening. When a character is deleted only the cars associated to that character should be deleted, not all cars associated to the license.
FOREIGN KEY (license) REFERENCES players (license) ON DELETE CASCADE ON UPDATE CASCADE
After reviewing the delete character function it doesn't appear that the license is even used to delete characters, just the citizenID.
I wasn't 100% sure if this is used for anything else so that's why I opened this issue instead of a PR.
Current Version
1.4.1
Custom Resources
N/A
The text was updated successfully, but these errors were encountered:
Summary
Deleting a character will trigger the foreign key cascade for all cars attached to the license instead of just the cars of the character being deleted.
Reproduction
Expected behavior
Don't delete cars from other characters that are not being deleted. Just delete the cars of the character that is being deleted.
Actual behavior
All cars of all characters with the same license are deleted because of the cascade delete from the foreign key.
Additional context
I believe removing the foreign key will prevent this from happening. When a character is deleted only the cars associated to that character should be deleted, not all cars associated to the license.
FOREIGN KEY (
license) REFERENCES
players(
license) ON DELETE CASCADE ON UPDATE CASCADE
After reviewing the delete character function it doesn't appear that the license is even used to delete characters, just the citizenID.
I wasn't 100% sure if this is used for anything else so that's why I opened this issue instead of a PR.
Current Version
1.4.1
Custom Resources
N/A
The text was updated successfully, but these errors were encountered: