Skip to content

fix(migrations): clean up category audit logs on down migration#219

Open
senutpal wants to merge 1 commit into
fossology:mainfrom
senutpal:fix/issue-212
Open

fix(migrations): clean up category audit logs on down migration#219
senutpal wants to merge 1 commit into
fossology:mainfrom
senutpal:fix/issue-212

Conversation

@senutpal

Copy link
Copy Markdown

Changes

  • Fix missing cleanup of polymorphic audit and change logs where type = 'CATEGORY' in the 000016_obligation_categories down migration.
  • Add DELETE statements before dropping obligation_categories to prevent dangling records and referential inconsistency.
  • Fixes Configurable Category Down Migration #212

Submitter Checklist

  • Includes tests (if there is a feature changed/added)
  • Includes docs ( if changes are user facing)
  • I have tested my changes locally.

References

Context: The 000016_obligation_categories down migration rolls back configurable categories by dropping the obligation_categories table. However, it fails to clean up polymorphic records in audits (and referencing change_logs) where type = 'CATEGORY'. This leaves dangling log entries that reference non-existent entities, polluting the database state on rollback.

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.

Configurable Category Down Migration

1 participant