Class: Nandi::Instructions::AddIndex
- Inherits:
-
Object
- Object
- Nandi::Instructions::AddIndex
- Defined in:
- lib/nandi/instructions/add_index.rb
Instance Attribute Summary collapse
-
#fields ⇒ Object
readonly
Returns the value of attribute fields.
-
#table ⇒ Object
readonly
Returns the value of attribute table.
Instance Method Summary collapse
- #extra_args ⇒ Object
-
#initialize(fields:, table:, **kwargs) ⇒ AddIndex
constructor
A new instance of AddIndex.
- #lock ⇒ Object
- #procedure ⇒ Object
Constructor Details
#initialize(fields:, table:, **kwargs) ⇒ AddIndex
Returns a new instance of AddIndex.
6 7 8 9 10 11 12 |
# File 'lib/nandi/instructions/add_index.rb', line 6 def initialize(fields:, table:, **kwargs) @fields = Array(fields) @fields = @fields.first if @fields.one? @table = table @extra_args = kwargs end |
Instance Attribute Details
#fields ⇒ Object (readonly)
Returns the value of attribute fields.
35 36 37 |
# File 'lib/nandi/instructions/add_index.rb', line 35 def fields @fields end |
#table ⇒ Object (readonly)
Returns the value of attribute table.
35 36 37 |
# File 'lib/nandi/instructions/add_index.rb', line 35 def table @table end |
Instance Method Details
#extra_args ⇒ Object
18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/nandi/instructions/add_index.rb', line 18 def extra_args { # Overridable defaults name: name, # Overrides and extra options **extra_args_with_default_index_type, # Mandatory values algorithm: :concurrently, } end |
#lock ⇒ Object
31 32 33 |
# File 'lib/nandi/instructions/add_index.rb', line 31 def lock Nandi::Migration::LockWeights::SHARE end |
#procedure ⇒ Object
14 15 16 |
# File 'lib/nandi/instructions/add_index.rb', line 14 def procedure :add_index end |