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
- #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 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, ) @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 638
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 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 ]#name
[ GitHub ]# File 'activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb', line 636
def name; @td.name; end