Class: Nandi::Instructions::AddColumn

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(table:, name:, type:, **kwargs) ⇒ AddColumn

Returns a new instance of AddColumn.



8
9
10
11
12
13
# File 'lib/nandi/instructions/add_column.rb', line 8

def initialize(table:, name:, type:, **kwargs)
  @table = table
  @name = name
  @type = type
  @extra_args = kwargs
end

Instance Attribute Details

#extra_argsObject (readonly)

Returns the value of attribute extra_args.



6
7
8
# File 'lib/nandi/instructions/add_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/add_column.rb', line 6

def name
  @name
end

#tableObject (readonly)

Returns the value of attribute table.



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

def table
  @table
end

#typeObject (readonly)

Returns the value of attribute type.



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

def type
  @type
end

Instance Method Details

#lockObject



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

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

#procedureObject



15
16
17
# File 'lib/nandi/instructions/add_column.rb', line 15

def procedure
  :add_column
end