Class: ActiveRecord::Migration::Compatibility::V6_0

Inherits:
V6_1
  • Object
show all
Defined in:
activerecord/lib/active_record/migration/compatibility.rb

Direct Known Subclasses

V5_2

Defined Under Namespace

Modules: TableDefinition Classes: ReferenceDefinition

Instance Method Summary collapse

Methods inherited from V6_1

#add_column

Instance Method Details

#add_reference(table_name, ref_name, **options) ⇒ Object Also known as: add_belongs_to


119
120
121
122
# File 'activerecord/lib/active_record/migration/compatibility.rb', line 119

def add_reference(table_name, ref_name, **options)
  ReferenceDefinition.new(ref_name, **options)
    .add_to(connection.update_table_definition(table_name, self))
end

#change_table(table_name, **options) ⇒ Object


103
104
105
106
107
108
109
# File 'activerecord/lib/active_record/migration/compatibility.rb', line 103

def change_table(table_name, **options)
  if block_given?
    super { |t| yield compatible_table_definition(t) }
  else
    super
  end
end

#create_join_table(table_1, table_2, **options) ⇒ Object


111
112
113
114
115
116
117
# File 'activerecord/lib/active_record/migration/compatibility.rb', line 111

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) ⇒ Object


95
96
97
98
99
100
101
# File 'activerecord/lib/active_record/migration/compatibility.rb', line 95

def create_table(table_name, **options)
  if block_given?
    super { |t| yield compatible_table_definition(t) }
  else
    super
  end
end