Is there a convenient way to remove obsolete table columns from the database? I'm wondering if there is a more convention-based solutions rather than logging into PHPMyADMIN and deleting columns manually.
Example
When installing SilverStripe-Fluent and adding an extra locale (eg nz-NZ) the module will split each SiteTree record to add extra translation columns with prefix _nz-NZ
. Suppose we delete the extra locale (nz-NZ), the columns will stay there after a /dev/build.
there was a great module DBPlumber for version 2.4 that had this function but I'm guessing you are using a later version! It would be great if this was upgraded for V3.
The module artefact cleaner would be ideal. Its description from the github page is...
Find and optionally delete disused tables and fields in a SilverStripe database.
During development of a SilverStripe application it is common to delete a data object class or remove a field from a data object. This leaves obsolete columns and tables in your database. Because these columns or tables may contain data that you still want, the SilverStripe framework doesn't delete those automatically. This task displays the obsolete columns and tables in the form of SQL DROP and ALTER commands. It also provides a way to delete them. If you do that, there is no undo, so always make a backup first.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With