Skip to content

Instantly share code, notes, and snippets.

@hwhelchel
Last active July 9, 2016 01:29
Show Gist options
  • Save hwhelchel/7fcbefc7a0013938d2e2 to your computer and use it in GitHub Desktop.
Save hwhelchel/7fcbefc7a0013938d2e2 to your computer and use it in GitHub Desktop.
Undesired Rails Schema Changed (Column moved etc.)
pg_dump --create --column-inserts app_development > dump.sql # or whatever your database is called
# edit dump.sql and change the column order
# stop webserver
rails db:drop
rails db:create
psql -f dump.sql app_development
rails db:migrate
rails db:test:prepare
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment