Skip to content

Instantly share code, notes, and snippets.

@replaid
Created Sep 22, 2014
Embed
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'")
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment