Skip to content

Instantly share code, notes, and snippets.

@fititnt
Created January 18, 2018 23:22
Show Gist options
  • Save fititnt/dfe99a0f0db5f84dcc403012c8ff6392 to your computer and use it in GitHub Desktop.
Save fititnt/dfe99a0f0db5f84dcc403012c8ff6392 to your computer and use it in GitHub Desktop.
--------- RUN QUERY 1 ---------
-- Run this query to get SQL to drop each table
SELECT concat('DROP TABLE IF EXISTS ', table_name, ';')
FROM information_schema.tables
WHERE table_schema = 'database_name';
-- Copy results
--------- RUN QUERY 2 ---------
SET FOREIGN_KEY_CHECKS = 2;
--- PASTE HERE RESULTS
SET FOREIGN_KEY_CHECKS = 1;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment