Skip to content

Instantly share code, notes, and snippets.

@DanielHeath
Created July 31, 2014 00:19
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DanielHeath/300609a17c4b6132cabb to your computer and use it in GitHub Desktop.
Save DanielHeath/300609a17c4b6132cabb to your computer and use it in GitHub Desktop.
Conflict free schema.rb
[merge "db_structure"]
name = regenerate_db_structure
driver = ./script/regenerate_structure && cp db/structure.sql %A
db/structure.sql merge=db_structure
#!/usr/bin/env bash
# Development DB often has useful data, use test env.
# db:setup uses existing structure file, so use db:migrate instead.
# I use structure.sql, if you're using schema.rb you want db:schema:dump instead of db:structure:dump
./bin/rake db:drop db:create db:migrate db:structure:dump RAILS_ENV=test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment