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
- .new(td) ⇒ AlterTable constructor
Instance Attribute Summary
- #adds readonly
- #check_constraint_adds readonly
- #check_constraint_drops readonly
- #foreign_key_adds readonly
- #foreign_key_drops readonly
Instance Method Summary
Constructor Details
.new(td) ⇒ AlterTable
# 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, ) @check_constraint_adds << @td.new_check_constraint_definition(expression, ) end
#add_column(name, type, **options)
[ GitHub ]#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, ) @foreign_key_adds << @td.new_foreign_key_definition(to_table, ) 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 ]#name
[ GitHub ]# File 'activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb', line 639
def name; @td.name; end