Class: Nandi::Instructions::RemoveIndex

Inherits:
Object
  • Object
show all
Defined in:
lib/nandi/instructions/remove_index.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(table:, field:) ⇒ RemoveIndex

Returns a new instance of RemoveIndex.



6
7
8
9
# File 'lib/nandi/instructions/remove_index.rb', line 6

def initialize(table:, field:)
  @table = table
  @field = field
end

Instance Attribute Details

#tableObject (readonly)

Returns the value of attribute table.



27
28
29
# File 'lib/nandi/instructions/remove_index.rb', line 27

def table
  @table
end

Instance Method Details

#extra_argsObject



15
16
17
18
19
20
21
# File 'lib/nandi/instructions/remove_index.rb', line 15

def extra_args
  if field.is_a?(Hash)
    field.merge(algorithm: :concurrently)
  else
    { column: columns, algorithm: :concurrently }
  end
end

#lockObject



23
24
25
# File 'lib/nandi/instructions/remove_index.rb', line 23

def lock
  Nandi::Migration::LockWeights::SHARE
end

#procedureObject



11
12
13
# File 'lib/nandi/instructions/remove_index.rb', line 11

def procedure
  :remove_index
end