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.
36 37 38 |
# File 'lib/nandi/instructions/add_index.rb', line 36 def fields @fields end |
#table ⇒ Object (readonly)
Returns the value of attribute table.
36 37 38 |
# File 'lib/nandi/instructions/add_index.rb', line 36 def table @table end |
Instance Method Details
#extra_args ⇒ Object
18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/nandi/instructions/add_index.rb', line 18 def extra_args { # Overridable defaults name: name, # Overrides and extra options **@extra_args, # Mandatory values algorithm: :concurrently, using: :btree, } end |
#lock ⇒ Object
32 33 34 |
# File 'lib/nandi/instructions/add_index.rb', line 32 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 |