You can always execute arbitrary SQL in migrations. For instance:
def up
execute('ALTER TABLE people ADD INDEX ...')
end
The one thing to keep in mind though is that if you use ruby schema format, your tests won't pick up those execute statements. In that case it's best to either use the sql format or re-run migrations in the test environment to set up the test db.