Class: ActiveRecord::Migration::Compatibility::V5_1
Direct Known Subclasses
Instance Method Summary collapse
- #change_column(table_name, column_name, type, **options) ⇒ Object
- #create_table(table_name, **options) ⇒ Object
Methods inherited from V5_2
Methods inherited from V6_0
Methods inherited from V6_1
Methods inherited from V7_0
#add_column, #add_foreign_key, #add_index, #add_reference, #change_column_null, #disable_extension, #rename_table
Instance Method Details
#change_column(table_name, column_name, type, **options) ⇒ Object
324 325 326 327 328 329 330 331 332 333 |
# File 'lib/active_record/migration/compatibility.rb', line 324 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) ⇒ Object
335 336 337 338 339 340 341 |
# File 'lib/active_record/migration/compatibility.rb', line 335 def create_table(table_name, **) if connection.adapter_name == "Mysql2" || connection.adapter_name == "Trilogy" super(table_name, options: "ENGINE=InnoDB", **) else super end end |