Class: ActiveRecord::Migration::Compatibility::V6_0
- Inherits:
-
V6_1
- Object
- V6_1
- 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
Methods inherited from V6_1
#add_column
Instance Method Details
#add_reference(table_name, ref_name, **options) ⇒ Object
Also known as:
add_belongs_to
132
133
134
135
136
137
138
139
|
# File 'lib/active_record/migration/compatibility.rb', line 132
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
116
117
118
119
120
121
122
|
# File 'lib/active_record/migration/compatibility.rb', line 116
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
124
125
126
127
128
129
130
|
# File 'lib/active_record/migration/compatibility.rb', line 124
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
108
109
110
111
112
113
114
|
# File 'lib/active_record/migration/compatibility.rb', line 108
def create_table(table_name, **options)
if block_given?
super { |t| yield compatible_table_definition(t) }
else
super
end
end
|