Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Quick query to find possible customer-data sensitive columns
SELECT table_schema, table_Name, column_name FROM information_schema.columns
WHERE table_schema = 'yourdatabasename' AND
(
column_name LIKE '%address%'
OR column_name LIKE '%email%'
OR column_name LIKE '%customer_%'
)
AND column_name NOT LIKE 'customer_%id%'
AND column_name NOT LIKE 'email_%id%'
ORDER BY table_name,ordinal_position
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.