B Seven
B Seven

Reputation: 45943

How to add indexes to Rails DB?

When adding an index to a table, is it as simple as writing a migration with:

add_index(:column_name)

And for the down method

remove_index(:column_name)

Are there any surprises I need to be aware of?

Working in Rails 3.07, Postgres. On Heroku.

Thanks.

Upvotes: 0

Views: 55

Answers (1)

sheldonh
sheldonh

Reputation: 2724

Why do I get the feeling this is a trick question?

Yes, it's that simple. No, there are no surprises, although very few people are ever glad of having made such a promise. :-)

Upvotes: 1

Related Questions