Right now, when deleting an environment, there is nothing to clean up facts and problems that have been registered against that environment.
The really big problem here (beyond the fact that we're not cleaning up data) is with multiple PR/ephemeral environments, if they're running insights, there is potentially a lot of insights information that is not even of any historical value.
This PR adds two things
Calls to queries that will clean up the appropriate facts and problems entries.
Adds a migration to remove any existing data that should be removed from the DB.
General Checklist
[ ] Affected Issues have been mentioned in the Closing issues section
[ ] Documentation has been written/updated
[ ] PR title is ready for inclusion in changelog
Database Migrations
[x] If your PR contains a database migation, it MUST be the latest in date order alphabetically
Right now, when deleting an environment, there is nothing to clean up facts and problems that have been registered against that environment.
The really big problem here (beyond the fact that we're not cleaning up data) is with multiple PR/ephemeral environments, if they're running insights, there is potentially a lot of insights information that is not even of any historical value.
This PR adds two things
General Checklist
Database Migrations