Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle the Cleanup of Resource Sharing Policies and Attributes During Resource, Attribute, and Organization Deletion #22199

Open
BimsaraBodaragama opened this issue Jan 7, 2025 · 1 comment
Assignees
Milestone

Comments

@BimsaraBodaragama
Copy link
Member

BimsaraBodaragama commented Jan 7, 2025

The proper cleanup of resource-sharing policies and shared attributes is critical to maintaining database consistency and avoiding unnecessary data accumulation. Currently, there is no mechanism to handle these cleanups systematically during deletions.

Is your feature request related to a problem? Please describe.

The current system does not clean up resource-sharing policies and shared attributes when resources, attributes, or organizations are deleted. This issue arises because resource-sharing policies are managed in a generalized table for all resources, and shared attributes are managed in a generalized table for all shared attributes. This results in:

  1. Inconsistencies in the database due to orphaned entries.
  2. Unnecessary accumulation of data, increasing storage usage.
  3. Difficulties in maintaining data integrity across organizational hierarchies.

Describe the solution you would prefer

Introduce SQL queries and implement the necessary methods to:

  1. Delete resource-sharing policies based on resource type and ID when resources are deleted.
  2. Delete shared attributes based on attribute type and ID when attributes are deleted.
  3. Delete resource-sharing policies based on organization ID when organizations are deleted.

Additionally, include unit tests to validate the correctness and reliability of these changes.

Additional context

Implementing these changes will:

  1. Maintain consistency and integrity of the database.
  2. Prevent unnecessary data accumulation.
  3. Simplify future maintenance by ensuring that deletions are handled efficiently and systematically.
@BimsaraBodaragama
Copy link
Member Author

You can track the PR here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: In Progress
Development

No branches or pull requests

2 participants