Skip to content

Instantly share code, notes, and snippets.

@vladimir-light
Last active August 29, 2015 14:11
Show Gist options
  • Save vladimir-light/9dec17d20e82bb997f1a to your computer and use it in GitHub Desktop.
Save vladimir-light/9dec17d20e82bb997f1a to your computer and use it in GitHub Desktop.
Find / Check All Foreign Keys of a DataBase
SELECT
constraint_name,
table_name
FROM
information_schema.table_constraints
WHERE
constraint_type = 'FOREIGN KEY'
AND table_schema = DATABASE()
ORDER BY
constraint_name;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment