123456789_123456789_123456789_123456789_123456789_

Class: ActiveRecord::Migration::Current

Do not use. This class is for internal use only.

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, **options)
  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, **options)
  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, **options)
  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, **options)
  if block_given?
    super { |t| yield compatible_table_definition(t) }
  else
    super
  end
end