Skip to content

Instantly share code, notes, and snippets.

@cantin
Created November 20, 2012 08:10
Show Gist options
  • Save cantin/4116680 to your computer and use it in GitHub Desktop.
Save cantin/4116680 to your computer and use it in GitHub Desktop.
dump sql and reload
> DB_STRUCTURE=db/null_schema.sql rake db:structure:dump
class NullMigration < ActiveRecord::Migration
def up
file_data = File.read('db/migrate/null_schema.sql')
ActiveRecord::Base.connection.execute file_data
end
def down
raise ActiveRecord::IrreversibleMigration
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment