VirtueMart Forum

VirtueMart 2 + 3 + 4 => Administration & Configuration => Topic started by: EvanGR on January 08, 2020, 13:58:36 PM

Title: Clean up custom fields table
Post by: EvanGR on January 08, 2020, 13:58:36 PM
I've noticed our database contains a lot of "bad" (redundant/unused/obsolete) entries for product<-->custom fields assignments. This became evident when we were exporting products into CSV, there were corrupted data in the custom fields.

Is there a way to re-build/cleanup the table "virtuemart_product_customfields"? (without losing useful data ofcourse)

Thanks
Title: Re: Clean up custom fields table
Post by: Studio 42 on January 08, 2020, 15:04:30 PM
It depend what you need to cleanup, but you have to use a mysql query to delete it.
Title: Re: Clean up custom fields table
Post by: EvanGR on January 08, 2020, 15:49:03 PM
I was hoping for an automated process to cleanup (or rebuild) the whole table, removing obsolete values.
e.g. removal of custom field relations, for fields that are no longer present
Title: Re: Clean up custom fields table
Post by: Studio 42 on January 08, 2020, 17:34:54 PM
I done a plugin to clear medias, you can do your own plugin for this case.