<![CDATA[ How to delete tv from database - My Forums]]> https://forums.modx.com/thread/?thread=12356 <![CDATA[Re: How to delete tv from database]]> https://forums.modx.com/thread/12356/how-to-delete-tv-from-database#dis-post-69790
For example I can (by mistake) unlink a TV from Template. If this is a bug then the content in the TV will be lost for all documents using that template. There is no going back if you don’t have a backup.

I think this should be done more like a module to clean the tables. The module can check for unused TVs and Templates and somehow delete them.
]]>
cipa Jan 19, 2010, 10:39 AM https://forums.modx.com/thread/12356/how-to-delete-tv-from-database#dis-post-69790
<![CDATA[Re: How to delete tv from database]]> https://forums.modx.com/thread/12356/how-to-delete-tv-from-database#dis-post-69789 )]]> rethrash Jan 19, 2010, 07:48 AM https://forums.modx.com/thread/12356/how-to-delete-tv-from-database#dis-post-69789 <![CDATA[Re: How to delete tv from database]]> https://forums.modx.com/thread/12356/how-to-delete-tv-from-database#dis-post-69788 I guess I will have to write my own SQL to do this job then. I was a little surprised to see this when optimizing my website performance. I have about several hundreds such ghost records, it’s not a big deal but ideally could be fixed and would benefit those who really want to make their modx sites tight and fast...]]> jimpsr Jan 17, 2010, 06:17 AM https://forums.modx.com/thread/12356/how-to-delete-tv-from-database#dis-post-69788 <![CDATA[Re: How to delete tv from database]]> https://forums.modx.com/thread/12356/how-to-delete-tv-from-database#dis-post-69787 Get the id of the template you will unbind the TV from

With the above look up all the documents that have the template ID above. See modx_site_content

Use the TV id with the list of document ids to delete rows from modx_site_tmplvar_contentvalues

For more info get familiar with the following tables

# modx_site_content
# modx_site_tmplvars
# modx_site_tmplvar_access
# modx_site_tmplvar_contentvalues


PS: I didn’t test this so make sure you make backups smiley
]]>
cipa Jan 15, 2010, 11:27 AM https://forums.modx.com/thread/12356/how-to-delete-tv-from-database#dis-post-69787
<![CDATA[Re: How to delete tv from database]]> https://forums.modx.com/thread/12356/how-to-delete-tv-from-database#dis-post-69786
I noticed if you delete the tv definition itself, then all tv values will be deleted, but if you only unbind tv from a template, then all tv values associated with documents of that template will not be deleted by default,so deleting by tv id is not gonna work.]]>
jimpsr Jan 14, 2010, 09:29 PM https://forums.modx.com/thread/12356/how-to-delete-tv-from-database#dis-post-69786
<![CDATA[Re: How to delete tv from database]]> https://forums.modx.com/thread/12356/how-to-delete-tv-from-database#dis-post-69785 cipa Jan 14, 2010, 08:59 AM https://forums.modx.com/thread/12356/how-to-delete-tv-from-database#dis-post-69785 <![CDATA[How to delete tv from database]]> https://forums.modx.com/thread/12356/how-to-delete-tv-from-database#dis-post-69784 jimpsr Jan 14, 2010, 07:52 AM https://forums.modx.com/thread/12356/how-to-delete-tv-from-database#dis-post-69784