Power-Components / livewire-powergrid

⚡ PowerGrid generates modern, powerful and easy-to-customize data tables using Laravel Livewire.
https://livewire-powergrid.com
MIT License
1.41k stars 206 forks source link

Clear Table Cache when running migrations #1531

Closed dansysanalyst closed 1 month ago

dansysanalyst commented 2 months ago

⚡ 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?