Class: ActiveRecord::Migration::Compatibility::V4_2
Defined Under Namespace
Modules: TableDefinition
Instance Method Summary collapse
- #add_reference(table_name, ref_name, **options) ⇒ Object (also: #add_belongs_to)
- #add_timestamps(table_name, **options) ⇒ Object
- #index_exists?(table_name, column_name, **options) ⇒ Boolean
- #remove_index(table_name, column_name = nil, **options) ⇒ Object
Methods inherited from V5_0
#add_column, #create_join_table, #create_table
Methods inherited from V5_1
Methods inherited from V5_2
#change_table, #create_join_table, #create_table
Methods inherited from V6_0
#change_table, #create_join_table, #create_table
Methods inherited from V6_1
#add_column, #change_table, #create_table
Methods inherited from V7_0
#add_column, #add_index, #change_column, #change_column_null, #change_table, #create_table, #disable_extension, #rename_table
Instance Method Details
#add_reference(table_name, ref_name, **options) ⇒ Object Also known as: add_belongs_to
467 468 469 470 |
# File 'activerecord/lib/active_record/migration/compatibility.rb', line 467 def add_reference(table_name, ref_name, **) [:index] ||= false super end |
#add_timestamps(table_name, **options) ⇒ Object
473 474 475 476 |
# File 'activerecord/lib/active_record/migration/compatibility.rb', line 473 def (table_name, **) [:null] = true if [:null].nil? super end |
#index_exists?(table_name, column_name, **options) ⇒ Boolean
478 479 480 481 482 483 484 485 486 487 |
# File 'activerecord/lib/active_record/migration/compatibility.rb', line 478 def index_exists?(table_name, column_name, **) column_names = Array(column_name).map(&:to_s) [:name] = if [:name].present? [:name].to_s else connection.index_name(table_name, column: column_names) end super end |
#remove_index(table_name, column_name = nil, **options) ⇒ Object
489 490 491 492 |
# File 'activerecord/lib/active_record/migration/compatibility.rb', line 489 def remove_index(table_name, column_name = nil, **) [:name] = index_name_for_remove(table_name, column_name, ) super end |