Class: ActiveRecord::Migration::Compatibility::V6_0
- Inherits:
-
V6_1
- Object
- ActiveRecord::Migration::Compatibility::V6_0
show all
- Defined in:
- lib/active_record/migration/compatibility.rb
Direct Known Subclasses
V5_2
Defined Under Namespace
Modules: TableDefinition
Classes: ReferenceDefinition
Instance Method Summary
collapse
Instance Method Details
#add_reference(table_name, ref_name, **options) ⇒ Object
Also known as:
add_belongs_to
57
58
59
60
61
62
63
64
|
# File 'lib/active_record/migration/compatibility.rb', line 57
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
41
42
43
44
45
46
47
|
# File 'lib/active_record/migration/compatibility.rb', line 41
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
49
50
51
52
53
54
55
|
# File 'lib/active_record/migration/compatibility.rb', line 49
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
33
34
35
36
37
38
39
|
# File 'lib/active_record/migration/compatibility.rb', line 33
def create_table(table_name, **options)
if block_given?
super { |t| yield compatible_table_definition(t) }
else
super
end
end
|