README.md in rubocop-oracle-0.1.0 vs README.md in rubocop-oracle-0.2.0

- old
+ new

@@ -17,9 +17,37 @@ ```ruby gem 'rubocop-oracle' ``` +## Cops + +This gem contains `Oracle/OnlineIndex` cop to check if indexing is possible without stopping Rails application' service using Oracle. +The cop supports safe migration for your production environment. + +### `Oracle/OnlineIndex` cop + +This cop checks for uses `options: online` option on `add_index`. +The `ONLINE` option is required if you want to run with OLTP when indexing migration in Oracle. + +```ruby +# bad +add_index :table_name, :column_name + +# good +add_index :table_name, :column_name, options: :online +``` + +By specifying `MigratedSchemaVersion` option, migration files that have been migrated can be ignored. + +```yaml +# .rubocop.yml +Oracle/OnlineIndex: + MigratedSchemaVersion: '202104130150' # Migration files lower than or equal to '202104130150' will be ignored. +``` + +This prevents detection of migration files that have already been applied to the production environment. + ## Usage You need to tell RuboCop to load the Oracle extension. There are three ways to do this: