Skip to content

Instantly share code, notes, and snippets.

@chrisbloom7
Created June 8, 2012 01:51
Show Gist options
  • Save chrisbloom7/2892962 to your computer and use it in GitHub Desktop.
Save chrisbloom7/2892962 to your computer and use it in GitHub Desktop.
Extend Rails' defaut set of rake tasks to add a db:bootstrap task. Similar to db:reset but doesn't use the schema file. Useful for testing your complete migration set (i.e. simulating a fresh setup) or for resetting your seed data in development.
namespace :db do
desc "Completely tears down the database, rebuilds it from scratch using your migrations (i.e. ignoring the current schema file), re-seeds the database based on the current environment, and finally prepares the test database"
task :bootstrap => ["db:drop", "db:create", "db:migrate", "db:seed", "db:test:prepare"]
end
@chrisbloom7
Copy link
Author

Currently getting an error during the db:seed portion - rails/arel#124. Not sure when or where this started happening, but seems to be coming from Arel.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment