Class: Migsupo::Differ::Operations::RemoveColumn

Inherits:
Object
  • Object
show all
Defined in:
lib/migsupo/differ/operations/remove_column.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(table_name:, column:) ⇒ RemoveColumn

Returns a new instance of RemoveColumn.



7
8
9
10
11
# File 'lib/migsupo/differ/operations/remove_column.rb', line 7

def initialize(table_name:, column:)
  @table_name = table_name.to_s
  @column     = column
  freeze
end

Instance Attribute Details

#columnObject (readonly)

Returns the value of attribute column.



5
6
7
# File 'lib/migsupo/differ/operations/remove_column.rb', line 5

def column
  @column
end

#table_nameObject (readonly)

Returns the value of attribute table_name.



5
6
7
# File 'lib/migsupo/differ/operations/remove_column.rb', line 5

def table_name
  @table_name
end

Instance Method Details

#column_nameObject



13
14
15
# File 'lib/migsupo/differ/operations/remove_column.rb', line 13

def column_name
  @column.name
end

#migration_typeObject



17
18
19
# File 'lib/migsupo/differ/operations/remove_column.rb', line 17

def migration_type
  :remove_column
end

#reversible?Boolean

Returns:

  • (Boolean)


21
22
23
# File 'lib/migsupo/differ/operations/remove_column.rb', line 21

def reversible?
  true
end

#to_sObject



25
26
27
# File 'lib/migsupo/differ/operations/remove_column.rb', line 25

def to_s
  "remove_column #{table_name}.#{column_name}"
end