Clear Table Cache when running migrations #1531
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
⚡ PowerGrid - Pull Request
Welcome and thank you for your interest in contributing to our project!. You must use this template to submit a Pull Request or it will not be accepted.
Motivation
Description
While this might be a bit of overengineering, this PR aims to mitgate the risk of using cached table schema after running a migration.
Users might face this problem during development, wasting time on debug and building frustration. We could also assume that an app might be deployed without cleaning caches.
Since we cannot retrieve the cache keys with a wildcard (e.g,
Cache::get('powergrid_columns_in_*)
, my idea is to keep a list of which columns are being cached. Alternativelly, we could just list every table in the database and try to wipe it's PG key.Of course, we can just discard this idea if it is too much.
Related Issue(s):
Documentation
This PR requires Documentation update?