ActiveRecord::SaneSchemaDumper

ActiveRecord::SaneSchemaDumper modifies the behavior of Rails’ ActiveRecord::SchemaDumper so that the generated db/schema.rb file doesn’t contain any useless/harmful whitespace column alignment.

Gem Version

Installation

Add this line to your application's Gemfile:

gem 'activerecord_sane_schema_dumper'

Usage

The gem modifies the behavior of Rails’ rake db:schema:dump task. This task is part of Rails migrations process to ensure that db/schema.rb stays in-sync with your local database.

It removes all useless whitespace that Rails adds so adding/modifying/removing columns from your tables only touches relevant lines (because other table lines do not try to stay aligned).

Before

create_table "event_data", force: true do |t|
  t.string   "event_external_id"
  t.json     "data",              default: {}
  t.datetime "created_at",                     null: false
  t.datetime "updated_at",                     null: false
end

After

create_table "event_data", force: true do |t|
  t.string "event_external_id"
  t.json "data", default: {}
  t.datetime "created_at", null: false
  t.datetime "updated_at", null: false
end

License

ActiveRecord::SaneSchemaDumper is © 2014 Mirego and may be freely distributed under the New BSD license. See the LICENSE.md file.

About Mirego

Mirego is a team of passionate people who believe that work is a place where you can innovate and have fun. We're a team of talented people who imagine and build beautiful Web and mobile applications. We come together to share ideas and change the world.

We also love open-source software and we try to give back to the community as much as we can.