Skip to content

Instantly share code, notes, and snippets.

@spannerinworks
Created March 18, 2015 13:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save spannerinworks/60e1d00884aa79edc3e4 to your computer and use it in GitHub Desktop.
Save spannerinworks/60e1d00884aa79edc3e4 to your computer and use it in GitHub Desktop.
Remigrate test database to create a clean schema.rb. For use during rebasing or when you have a dirty dev DB.
#!/bin/bash
set -v
git show integration:db/schema.rb > db/schema.rb
RAILS_ENV=test rake db:drop
RAILS_ENV=test rake db:create
RAILS_ENV=test rake db:schema:load
RAILS_ENV=test rake db:migrate
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment