Created
October 31, 2016 22:19
-
-
Save phil-hildebrand/5fd16b40a5e906d4bd2db476e6bb58ba to your computer and use it in GitHub Desktop.
Various MySQL tips / scripts
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
#!/bin/sh | |
# | |
# Auto discover and drop FKs: | |
# | |
mysql -s -e "select 'alter table ', table_name, ' drop foreign key ', constraint_name, ';' from information_schema.referential_constraints ;" > /tmp/disable_fk.sql | |
mysql -s < /tmp/disable_fk.sql |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment