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 626

def initialize(td)
  @td   = td
  @adds = []
  @foreign_key_adds = []
  @foreign_key_drops = []
  @check_constraint_adds = []
  @check_constraint_drops = []
  @constraint_drops = []
end

Instance Attribute Details

#adds (readonly)

[ GitHub ]

  
# File 'activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb', line 621

attr_reader :adds

#check_constraint_adds (readonly)

[ GitHub ]

  
# File 'activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb', line 623

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 623

attr_reader :check_constraint_adds, :check_constraint_drops

#constraint_drops (readonly)

[ GitHub ]

  
# File 'activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb', line 624

attr_reader :constraint_drops

#foreign_key_adds (readonly)

[ GitHub ]

  
# File 'activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb', line 622

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 622

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 646

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 658

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 638

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 650

def drop_check_constraint(constraint_name)
  @check_constraint_drops << constraint_name
end

#drop_constraint(constraint_name)

[ GitHub ]

  
# File 'activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb', line 654

def drop_constraint(constraint_name)
  @constraint_drops << constraint_name
end

#drop_foreign_key(name)

[ GitHub ]

  
# File 'activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb', line 642

def drop_foreign_key(name)
  @foreign_key_drops << name
end

#name

[ GitHub ]

  
# File 'activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb', line 636

def name; @td.name; end