Skip to content

Fix: Enable cascade delete for user-link relations to prevent errors on account deletion#3

Merged
ashleyhindle merged 4 commits intolaravel:mainfrom
HichemTab-tech:fix-user-delete
Sep 19, 2025
Merged

Fix: Enable cascade delete for user-link relations to prevent errors on account deletion#3
ashleyhindle merged 4 commits intolaravel:mainfrom
HichemTab-tech:fix-user-delete

Conversation

@HichemTab-tech
Copy link
Copy Markdown
Contributor

@HichemTab-tech HichemTab-tech commented Sep 18, 2025

Description

This PR fixes an issue where deleting a user account caused SQL errors due to missing cascade delete on related tables.

Changes

  • Adds a migration to update foreign key constraints for links, user_links, link_notes, and user_statuses tables, enabling ON DELETE CASCADE for all user and link relations.
  • Removes the unused password input from the DeleteUser component, as authentication is handled using Github.

fixes #2

@ashleyhindle
Copy link
Copy Markdown
Contributor

Changed link deletion to anonymization so user's don't lose bookmarks, and added a test 👌

Thanks for flagging and fixing @HichemTab-tech 🫶

@ashleyhindle ashleyhindle merged commit f88ee37 into laravel:main Sep 19, 2025
2 checks passed
@HichemTab-tech HichemTab-tech deleted the fix-user-delete branch September 19, 2025 09:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unable to delete user due to missing cascade delete relations

2 participants