Author Topic: Clean up custom fields table  (Read 461 times)

EvanGR

  • Jr. Member
  • **
  • Posts: 311
Clean up custom fields table
« 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

Studio 42

  • Contributing Developer
  • Sr. Member
  • *
  • Posts: 4225
  • Joomla & Virtuemart developper
    • Studio 42 - Virtuemart & Joomla extentions
  • VirtueMart Version: 2.6 & 3
Re: Clean up custom fields table
« Reply #1 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.

EvanGR

  • Jr. Member
  • **
  • Posts: 311
Re: Clean up custom fields table
« Reply #2 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

Studio 42

  • Contributing Developer
  • Sr. Member
  • *
  • Posts: 4225
  • Joomla & Virtuemart developper
    • Studio 42 - Virtuemart & Joomla extentions
  • VirtueMart Version: 2.6 & 3
Re: Clean up custom fields table
« Reply #3 on: January 08, 2020, 17:34:54 pm »
I done a plugin to clear medias, you can do your own plugin for this case.