Skip to content

Instantly share code, notes, and snippets.

Created Sep 22, 2014
What would you like to do?
Save test data into tab-separated files.
ActiveRecord::Base.connection.tables.each do |table_name|
ActiveRecord::Base.connection.execute("select * from #{table_name} into outfile '/tmp/datadump-#{table_name}.outfile'")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment