README.md in strong_migrations-1.4.1 vs README.md in strong_migrations-1.4.2
- old
+ new
@@ -838,26 +838,21 @@
StrongMigrations.auto_analyze = true
```
## Faster Migrations
-Only dump the schema when adding a new migration. If you use Git, add to the end of your `Rakefile`:
+Only dump the schema when adding a new migration. If you use Git, add to `config/environments/development.rb`:
```rb
-task :faster_migrations do
- ActiveRecord::Base.dump_schema_after_migration = Rails.env.development? &&
- `git status db/migrate/ --porcelain`.present?
-end
-
-task "db:migrate": "faster_migrations"
+config.active_record.dump_schema_after_migration = `git status db/migrate/ --porcelain`.present?
```
## Schema Sanity
-Columns can flip order in `db/schema.rb` when you have multiple developers. One way to prevent this is to [alphabetize them](https://www.pgrs.net/2008/03/12/alphabetize-schema-rb-columns/). Add to the end of your `Rakefile`:
+Columns can flip order in `db/schema.rb` when you have multiple developers. One way to prevent this is to [alphabetize them](https://www.pgrs.net/2008/03/12/alphabetize-schema-rb-columns/). Add to `config/initializers/strong_migrations.rb`:
```ruby
-task "db:schema:dump": "strong_migrations:alphabetize_columns"
+StrongMigrations.alphabetize_schema = true
```
## Permissions
We recommend using a [separate database user](https://ankane.org/postgres-users) for migrations when possible so you don’t need to grant your app user permission to alter tables.