Class: RuboCop::Cop::Oracle::OnlineIndex
- Inherits:
-
Base
- Object
- Base
- RuboCop::Cop::Oracle::OnlineIndex
- Extended by:
- AutoCorrector
- Defined in:
- lib/rubocop/cop/oracle/online_index.rb
Overview
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.
By specifying MigratedSchemaVersion option, migration files that have been migrated can be ignored.
Constant Summary collapse
- MSG =
'Specify `options: :online` option to `add_index`.'- RESTRICT_ON_SEND =
%i[add_index].freeze
Instance Method Summary collapse
Instance Method Details
#on_send(node) ⇒ Object
32 33 34 35 36 37 38 |
# File 'lib/rubocop/cop/oracle/online_index.rb', line 32 def on_send(node) return if already_migrated_file? || use_online_option?(node.last_argument) add_offense(node.loc.selector) do |corrector| corrector.insert_after(node, ', options: :online') end end |