Today I wrote a simple solution for emptying a Mysql database in Rails is as follows:

Solutions for other dbms vary because not everyone implements the information schema e.g. SQLite