There’s a legacy app I work on that currently requires adding 4 columns and a couple rows (in different tables) every time you add a row to another table. It doesn’t happen often and it would be a nightmare to refactor so I wrote little script that would search the database for any columns named ‘x’ as well as any fields with a value of ‘x’ and return an array of the offending tables.
I cleaned it up a little bit and cfc-ized it in case I ever have to do anything similar. I haven’t tested it at all aside from the one time I ran it today so use it at your own risk. It’s really simple to use, you just need to pass in the ColdFusion datasource name and the search term.
Example Usage:
Looking for column #search_term#
Looking for value #search_term#
Download ColdFusion MySQL Search Utility!
PS: it won’t search numeric columns if you aren’t searching for a number.