Skip to content

Instantly share code, notes, and snippets.

@jaynarayan89
Created November 1, 2017 13:03
Show Gist options
  • Save jaynarayan89/26389f23234db8bac434c976f5e23800 to your computer and use it in GitHub Desktop.
Save jaynarayan89/26389f23234db8bac434c976f5e23800 to your computer and use it in GitHub Desktop.
SELECT concat('alter table ',table_schema,'.',table_name,' DROP FOREIGN KEY ',constraint_name,';')
FROM information_schema.table_constraints
WHERE constraint_type='FOREIGN KEY'
AND table_schema='!!YOUR_SCHEMA_HERE!!';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment