Class: ActiveRecord::Migration::Current
Do not use. This class is for internal use only.
| Relationships & Source Files | |
| Extension / Inclusion / Inheritance Descendants | |
|
Subclasses:
Schema, ActiveRecord::Migration::Compatibility::V4_2, ActiveRecord::Migration::Compatibility::V5_0, ActiveRecord::Migration::Compatibility::V5_1, ActiveRecord::Migration::Compatibility::V5_2, ActiveRecord::Migration::Compatibility::V6_0, ActiveRecord::Migration::Compatibility::V6_1, ActiveRecord::Migration::Compatibility::V7_0, ActiveRecord::Migration::Compatibility::V7_1, ActiveRecord::Migration::Compatibility::V7_2, ActiveRecord::Migration::Compatibility::V8_0, ActiveRecord::Migration::Compatibility::V8_1
|
|
| Super Chains via Extension / Inclusion / Inheritance | |
|
Class Chain:
self,
Migration
|
|
|
Instance Chain:
self,
Migration
|
|
| Inherits: |
Migration
|
| Defined in: | activerecord/lib/active_record/migration.rb |
Overview
This must be defined before the inherited hook, below
Instance Method Summary
Instance Method Details
#change_table(table_name, **options)
[ GitHub ]# File 'activerecord/lib/active_record/migration.rb', line 590
def change_table(table_name, **) if block_given? super { |t| yield compatible_table_definition(t) } else super end end
#compatible_table_definition(t)
[ GitHub ]# File 'activerecord/lib/active_record/migration.rb', line 614
def compatible_table_definition(t) behaviors = compatibility_behavior.class.ancestors.select { |klass| klass <= CompatibilityBehavior }.reverse (behaviors + (self.class.ancestors & Compatibility.version_classes)).each do |klass| next unless klass.const_defined?(:TableDefinition, false) t.singleton_class.prepend(klass.const_get(:TableDefinition, false)) end t end
#create_join_table(table_1, table_2, **options)
[ GitHub ]# File 'activerecord/lib/active_record/migration.rb', line 598
def create_join_table(table_1, table_2, **) if block_given? super { |t| yield compatible_table_definition(t) } else super end end
#create_table(table_name, **options)
[ GitHub ]# File 'activerecord/lib/active_record/migration.rb', line 582
def create_table(table_name, **) if block_given? super { |t| yield compatible_table_definition(t) } else super end end
#drop_table(*table_names, **options)
[ GitHub ]# File 'activerecord/lib/active_record/migration.rb', line 606
def drop_table(*table_names, **) if block_given? super { |t| yield compatible_table_definition(t) } else super end end