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

Inherits:
V6_1 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

Methods inherited from V7_0

#add_column, #add_index, #change_column, #change_column_null, #disable_extension, #rename_table

Instance Method Details

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



263
264
265
266
267
268
269
270
# File 'activerecord/lib/active_record/migration/compatibility.rb', line 263

def add_reference(table_name, ref_name, **options)
  if connection.adapter_name == "SQLite"
    options[:type] = :integer
  end

  options[:_uses_legacy_reference_index_name] = true
  super
end

#change_table(table_name, **options) ⇒ Object



247
248
249
250
251
252
253
# File 'activerecord/lib/active_record/migration/compatibility.rb', line 247

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



255
256
257
258
259
260
261
# File 'activerecord/lib/active_record/migration/compatibility.rb', line 255

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



239
240
241
242
243
244
245
# File 'activerecord/lib/active_record/migration/compatibility.rb', line 239

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