[PR #5844] [MERGED] Updated handling of deleted user ID handling in DB #6580

Closed
opened 2026-02-05 10:36:00 +03:00 by OVERLORD · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/BookStackApp/BookStack/pull/5844
Author: @ssddanbrown
Created: 10/19/2025
Status: Merged
Merged: 10/21/2025
Merged by: @ssddanbrown

Base: developmentHead: user_ids


📝 Commits (2)

  • 5754acf DB: Updated handling of deleted user ID handling in DB
  • efff870 DB: Addressed test issues for user ID changes

📊 Changes

24 files changed (+525 additions, -56 deletions)

View changed files

📝 app/Access/Mfa/MfaValue.php (+3 -0)
📝 app/Access/SocialAccount.php (+9 -4)
📝 app/Activity/Models/Activity.php (+3 -0)
📝 app/Activity/Models/Favourite.php (+3 -0)
📝 app/Activity/Models/Watch.php (+3 -0)
📝 app/Entities/Models/Deletion.php (+3 -0)
📝 app/Entities/Models/PageRevision.php (+3 -0)
📝 app/Users/Models/User.php (+0 -2)
📝 app/Users/UserRepo.php (+47 -17)
database/factories/Access/Mfa/MfaValueFactory.php (+28 -0)
database/factories/Access/SocialAccountFactory.php (+29 -0)
database/factories/Activity/Models/ActivityFactory.php (+34 -0)
database/factories/Activity/Models/FavouriteFactory.php (+31 -0)
database/factories/Activity/Models/WatchFactory.php (+33 -0)
database/factories/Entities/Models/DeletionFactory.php (+29 -0)
📝 database/factories/Entities/Models/PageFactory.php (+1 -3)
database/factories/Entities/Models/PageRevisionFactory.php (+40 -0)
📝 database/migrations/2025_09_15_134751_update_entity_relation_columns.php (+2 -1)
database/migrations/2025_10_18_163331_clean_user_id_references.php (+76 -0)
📝 resources/views/settings/audit.blade.php (+5 -1)

...and 4 more files

📄 Description

Updated uses of user ID to nullify on delete.
Added testing to cover deletion of user relations.
Added model factories to support changes and potential other tests.
Cleans existing ID references in the DB via migration.

Aligns with entity changes to get the database in a cleaner & more consistent state.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/BookStackApp/BookStack/pull/5844 **Author:** [@ssddanbrown](https://github.com/ssddanbrown) **Created:** 10/19/2025 **Status:** ✅ Merged **Merged:** 10/21/2025 **Merged by:** [@ssddanbrown](https://github.com/ssddanbrown) **Base:** `development` ← **Head:** `user_ids` --- ### 📝 Commits (2) - [`5754acf`](https://github.com/BookStackApp/BookStack/commit/5754acf2fb9fcb60bb2ffd95bab3b0bcb1b162fd) DB: Updated handling of deleted user ID handling in DB - [`efff870`](https://github.com/BookStackApp/BookStack/commit/efff8700d47f83ab9c4c83b27143d9a27dc69c9a) DB: Addressed test issues for user ID changes ### 📊 Changes **24 files changed** (+525 additions, -56 deletions) <details> <summary>View changed files</summary> 📝 `app/Access/Mfa/MfaValue.php` (+3 -0) 📝 `app/Access/SocialAccount.php` (+9 -4) 📝 `app/Activity/Models/Activity.php` (+3 -0) 📝 `app/Activity/Models/Favourite.php` (+3 -0) 📝 `app/Activity/Models/Watch.php` (+3 -0) 📝 `app/Entities/Models/Deletion.php` (+3 -0) 📝 `app/Entities/Models/PageRevision.php` (+3 -0) 📝 `app/Users/Models/User.php` (+0 -2) 📝 `app/Users/UserRepo.php` (+47 -17) ➕ `database/factories/Access/Mfa/MfaValueFactory.php` (+28 -0) ➕ `database/factories/Access/SocialAccountFactory.php` (+29 -0) ➕ `database/factories/Activity/Models/ActivityFactory.php` (+34 -0) ➕ `database/factories/Activity/Models/FavouriteFactory.php` (+31 -0) ➕ `database/factories/Activity/Models/WatchFactory.php` (+33 -0) ➕ `database/factories/Entities/Models/DeletionFactory.php` (+29 -0) 📝 `database/factories/Entities/Models/PageFactory.php` (+1 -3) ➕ `database/factories/Entities/Models/PageRevisionFactory.php` (+40 -0) 📝 `database/migrations/2025_09_15_134751_update_entity_relation_columns.php` (+2 -1) ➕ `database/migrations/2025_10_18_163331_clean_user_id_references.php` (+76 -0) 📝 `resources/views/settings/audit.blade.php` (+5 -1) _...and 4 more files_ </details> ### 📄 Description Updated uses of user ID to nullify on delete. Added testing to cover deletion of user relations. Added model factories to support changes and potential other tests. Cleans existing ID references in the DB via migration. Aligns with entity changes to get the database in a cleaner & more consistent state. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
OVERLORD added the pull-request label 2026-02-05 10:36:00 +03:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#6580