Created
August 21, 2019 18:50
-
-
Save thiagoeliasr/d283e1b90c902e7981b3faf363eb9bb4 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
# Code below will show the truncate code for all tables in desired schema | |
SELECT | |
Concat('TRUNCATE TABLE ', TABLE_NAME, ';') | |
FROM | |
INFORMATION_SCHEMA.TABLES | |
WHERE | |
table_schema = 'your-table'; | |
# disabling foreign checks for a while | |
SET FOREIGN_KEY_CHECKS=0; | |
# put the result of select above here | |
SET FOREIGN_KEY_CHECKS=1; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment