Created
August 9, 2011 11:01
-
-
Save dsueiro/1133763 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 concat('alter table `', table_name ,'` add constraint `', constraint_name, '` foreign key (`', column_name ,'`) references `', referenced_table_name , '` (`',referenced_column_name,'`)') from information_schema.key_column_usage where table_schema = 'siic_v2' and constraint_name not like 'PRIMARY%'; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment