Let's say I do Image.column_names
and that shows all the columns such as post_id
but how do I check if post_id
has an index on it?
There is an index_exists? method on one of the ActiveRecord "connection adapters" classes.
You can use it like this:
ActiveRecord::Migration.connection.index_exists? :images, :post_id
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With