Class: ActiveRecord::Migration::Compatibility::V5_1
- Defined in:
- lib/active_record/migration/compatibility.rb
Direct Known Subclasses
Instance Method Summary collapse
- #change_column(table_name, column_name, type, options = {}) ⇒ Object
- #create_table(table_name, options = {}) ⇒ Object
Instance Method Details
#change_column(table_name, column_name, type, options = {}) ⇒ Object
19 20 21 22 23 24 25 26 27 28 |
# File 'lib/active_record/migration/compatibility.rb', line 19 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
30 31 32 33 34 35 36 |
# File 'lib/active_record/migration/compatibility.rb', line 30 def create_table(table_name, = {}) if connection.adapter_name == "Mysql2" super(table_name, options: "ENGINE=InnoDB", **) else super end end |