123456789_123456789_123456789_123456789_123456789_

Class: ActiveRecord::ConnectionAdapters::AlterTable

Do not use. This class is for internal use only.
Relationships & Source Files
Extension / Inclusion / Inheritance Descendants
Subclasses:
Inherits: Object
Defined in: activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb

Class Method Summary

Instance Attribute Summary

Instance Method Summary

Constructor Details

.new(td) ⇒ AlterTable

[ GitHub ]

  
# File 'activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb', line 630
def initialize(td)
  @td   = td
  @adds = []
  @foreign_key_adds = []
  @foreign_key_drops = []
  @check_constraint_adds = []
  @check_constraint_drops = []
end

Instance Attribute Details

#adds (readonly)

[ GitHub ]

  
# File 'activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb', line 626
attr_reader :adds

#check_constraint_adds (readonly)

[ GitHub ]

  
# File 'activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb', line 628
attr_reader :check_constraint_adds, :check_constraint_drops

#check_constraint_drops (readonly)

[ GitHub ]

  
# File 'activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb', line 628
attr_reader :check_constraint_adds, :check_constraint_drops

#foreign_key_adds (readonly)

[ GitHub ]

  
# File 'activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb', line 627
attr_reader :foreign_key_adds, :foreign_key_drops

#foreign_key_drops (readonly)

[ GitHub ]

  
# File 'activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb', line 627
attr_reader :foreign_key_adds, :foreign_key_drops

Instance Method Details

#add_check_constraint(expression, options)

[ GitHub ]

  
# File 'activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb', line 649
def add_check_constraint(expression, options)
  @check_constraint_adds << @td.new_check_constraint_definition(expression, options)
end

#add_column(name, type, **options)

[ GitHub ]

  
# File 'activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb', line 657
def add_column(name, type, **options)
  name = name.to_s
  type = type.to_sym
  @adds << AddColumnDefinition.new(@td.new_column_definition(name, type, **options))
end

#add_foreign_key(to_table, options)

[ GitHub ]

  
# File 'activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb', line 641
def add_foreign_key(to_table, options)
  @foreign_key_adds << @td.new_foreign_key_definition(to_table, options)
end

#drop_check_constraint(constraint_name)

[ GitHub ]

  
# File 'activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb', line 653
def drop_check_constraint(constraint_name)
  @check_constraint_drops << constraint_name
end

#drop_foreign_key(name)

[ GitHub ]

  
# File 'activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb', line 645
def drop_foreign_key(name)
  @foreign_key_drops << name
end

#name

[ GitHub ]

  
# File 'activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb', line 639
def name; @td.name; end