Skip to content

Add User Deletion Stored Procedures #149

@davidwickman

Description

@davidwickman

Problem

No systematic way to delete users and cleanup all their related data across the database. Needed for GDPR compliance and account management.

Solution

Create two stored procedures following existing patterns:

  1. sp_user_delete(user_id) - Delete user and all dependencies
  2. fn_user_dependencies_count(user_id) - Dry run preview

Tables Affected

  • Import system: import_file_chunk, import_file, import_log_message, import_log_warning, import_log
  • Profiles: profile_attribute, data_type, profile_type_definition_*, profile_*
  • Files: nodeset_file
  • Core: user

Usage

-- Preview what will be deleted
SELECT * FROM fn_user_dependencies_count(243);

-- Execute deletion
CALL sp_user_delete(243);

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions