Skip to content

Instantly share code, notes, and snippets.

@replaid
Created September 22, 2014 18:21
Show Gist options
  • Save replaid/5ed66edef03847e246b5 to your computer and use it in GitHub Desktop.
Save replaid/5ed66edef03847e246b5 to your computer and use it in GitHub Desktop.
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