README.md in strong_migrations-0.6.5 vs README.md in strong_migrations-0.6.6

- old
+ new

@@ -16,12 +16,16 @@ ```ruby gem 'strong_migrations' ``` -We highly recommend [setting timeouts](#timeouts). You can [mark existing migrations as safe](#existing-migrations) as well. +And run: +```sh +rails generate strong_migrations:install +``` + ## Checks Potentially dangerous operations: - [removing a column](#removing-a-column) @@ -619,24 +623,24 @@ Check the [source code](https://github.com/ankane/strong_migrations/blob/master/lib/strong_migrations.rb) for the list of keys. ## Timeouts -It’s a good idea to set a long statement timeout and a short lock timeout for migrations. This way, migrations can run for a while, and if a migration can’t acquire a lock in a timely manner, other statements won’t be stuck behind it. +It’s extremely important to set a short lock timeout for migrations. This way, if a migration can’t acquire a lock in a timely manner, other statements won’t be stuck behind it. We also recommend setting a long statement timeout so migrations can run for a while. Create `config/initializers/strong_migrations.rb` with: ```ruby -StrongMigrations.statement_timeout = 1.hour StrongMigrations.lock_timeout = 10.seconds +StrongMigrations.statement_timeout = 1.hour ``` Or set the timeouts directly on the database user that runs migrations. For Postgres, use: ```sql -ALTER ROLE myuser SET statement_timeout = '1h'; ALTER ROLE myuser SET lock_timeout = '10s'; +ALTER ROLE myuser SET statement_timeout = '1h'; ``` Note: If you use PgBouncer in transaction mode, you must set timeouts on the database user. ## Existing Migrations @@ -649,10 +653,10 @@ Use the version from your latest migration. ## Target Version -If your development database version is different from production, you can specify the production version so the right checks are run in development. +If your development database version is different from production, you can specify the production version so the right checks run in development. ```ruby StrongMigrations.target_postgresql_version = "10" StrongMigrations.target_mysql_version = "8.0.12" StrongMigrations.target_mariadb_version = "10.3.2"