README.md in birdspotting-0.1.0 vs README.md in birdspotting-0.1.1

- old
+ new

@@ -1,10 +1,14 @@ # Birdspotting Some add-ons on `ActiveRecord::Migration` to make migration safer in the context of zero downtime deployment. +[![Gem Version](https://badge.fury.io/rb/birdspotting.svg)](https://badge.fury.io/rb/birdspotting) +[![Maintainability](https://api.codeclimate.com/v1/badges/4a272a3f849869a200df/maintainability)](https://codeclimate.com/github/drivy/birdspotting/maintainability) +[![Test Coverage](https://api.codeclimate.com/v1/badges/4a272a3f849869a200df/test_coverage)](https://codeclimate.com/github/drivy/birdspotting/test_coverage) + ## Installation Add this line to your application's Gemfile: ```ruby @@ -46,12 +50,18 @@ #### Common configuration `start_check_at` allows to start the checks after some migration version only. Set it to a migration timestamp like 20151209000000 for instance. When nil, all migrations will be checked. -`check_bypass_env_var` specify the ENV var allowing to bypass the checks. +`check_bypass_env_var` specify the ENV var allowing to bypass the checks. Use it to bypass temporarily all the checks so you do it intentionally. You can set it to any value, it's just testing it's set. +For instance if check_bypass_env_var is set to BYPASS_SCHEMA_STATEMENTS_CHECK (the default) you can do: + +``` +BYPASS_SCHEMA_STATEMENTS_CHECK=true rails db:migrate:up VERSION=20180806142044 +``` + ### add_column request position We like to keep or columns organised for the case where we don't use the ORM but some other client. This will raise a `Birdspotting::ColumnPositionMissingError` error if neither `:first` or `:after` @@ -72,25 +82,26 @@ By default, we don't want to use the rename column possibility as it will break any live application. And we want to be able to release and run migration without downtime. Though when a rename_column is used, it will raise a `Birdspotting::RenameColumnForbiddenError`. You can skip this validation by setting `rename_column_check` to `false`. -You can customise the warning message by using the `rename_column_message` setting. +You can customise the warning message by using the `rename_column_message` setting. +You might like to customize the warning message to be a link to an internal set of instructions for the correct way to do this. ### remove_column By default, we don't want to be able to remove a columns which is still in use by a the application. Thus we check if the column is still present in the columns list. - If we are not able to find the model, we issue a `Birdspotting::ModelNotFoundError`. - If the column is still present in the model, we issue a `Birdspotting::RemoveColumnForbiddenError`. -We advise to set the column in the `ignored_columns` of the model. +We advise to set the column in the `ignored_columns` of the model. (See [this blog article](https://blog.bigbinary.com/2016/05/24/rails-5-adds-active-record-ignored-columns.html)) You can skip this validation by setting `remove_column_check` to `false`. -### reorder columns [mySql only] +### reorder_columns [mySql only] As said above, we like to keep or columns organised for the case where we don't use the ORM but some other client. This helper allow to reorder all the columns of a table.