Class: Nandi::Instructions::RemoveColumn

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(table:, name:, **extra_args) ⇒ RemoveColumn

Returns a new instance of RemoveColumn.



8
9
10
11
12
13
14
15
16
17
# File 'lib/nandi/instructions/remove_column.rb', line 8

def initialize(table:, name:, **extra_args)
  @table = table
  @name = name
  @extra_args =
    if extra_args.any?
      extra_args
    else
      {}
    end
end

Instance Attribute Details

#extra_argsObject (readonly)

Returns the value of attribute extra_args.



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

def extra_args
  @extra_args
end

#nameObject (readonly)

Returns the value of attribute name.



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

def name
  @name
end

#tableObject (readonly)

Returns the value of attribute table.



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

def table
  @table
end

Instance Method Details

#lockObject



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

def lock
  Nandi::Migration::LockWeights::ACCESS_EXCLUSIVE
end

#procedureObject



19
20
21
# File 'lib/nandi/instructions/remove_column.rb', line 19

def procedure
  :remove_column
end