Class: ActiveRecord::Migration::Compatibility::V5_1
Do not use. This class is for internal use only.
| Relationships & Source Files | |
| Extension / Inclusion / Inheritance Descendants | |
|
Subclasses:
|
|
| Super Chains via Extension / Inclusion / Inheritance | |
|
Class Chain:
|
|
|
Instance Chain:
self,
V5_2,
V6_0,
V6_1,
V7_0,
V7_0::LegacyIndexName,
V7_1,
V7_2,
V8_0,
V8_0::RemoveForeignKeyColumnMatch,
::ActiveRecord::Migration::Current,
Migration
|
|
| Inherits: |
ActiveRecord::Migration::Compatibility::V5_2
|
| Defined in: | activerecord/lib/active_record/migration/compatibility.rb |
Instance Method Summary
V5_2 - Inherited
V6_0 - Inherited
V6_1 - Inherited
V7_0 - Inherited
V7_0::LegacyIndexName - Included
V8_0 - Inherited
V8_0::RemoveForeignKeyColumnMatch - Included
::ActiveRecord::Migration::Current - Inherited
Instance Method Details
#change_column(table_name, column_name, type, **options)
[ GitHub ]# File 'activerecord/lib/active_record/migration/compatibility.rb', line 341
def change_column(table_name, column_name, type, **) if connection.adapter_name == "PostgreSQL" super(table_name, column_name, type, **.except(:default, :null, :comment)) connection.change_column_default(table_name, column_name, [:default]) if .key?(:default) connection.change_column_null(table_name, column_name, [:null], [:default]) if .key?(:null) connection.change_column_comment(table_name, column_name, [:comment]) if .key?(:comment) else super end end
#create_table(table_name, **options)
[ GitHub ]# File 'activerecord/lib/active_record/migration/compatibility.rb', line 352
def create_table(table_name, **) if connection.adapter_name == "Mysql2" || connection.adapter_name == "Trilogy" super(table_name, options: "ENGINE=InnoDB", **) else super end end