Created
June 19, 2009 10:05
-
-
Save IcyMidnight/132538 to your computer and use it in GitHub Desktop.
Show All Foreign Keys in MySQL
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT constraint_schema AS `database`, constraint_name, concat(table_name, '.', column_name) AS 'foreign key', concat(referenced_table_name, '.', referenced_column_name) AS 'references' FROM information_schema.key_column_usage WHERE referenced_table_name IS NOT NULL; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment