What is the difference between
t.boolean :is_live, index: true
and
add_index :table_name, :is_live
If there is no difference, how come only the add_index
is reflected in schema.rb. When I use index: true
, I can't actually see the index in schema.rb
. Should I only use the add_index
method.
When use the add_index
method, I can see this in my schema.rb
add_index "table_name", ["is_live"], name: "index_table_name_on_is_live", using: :blahblah