Skip to content

Instantly share code, notes, and snippets.

@chsh
Last active December 22, 2015 04:49
Show Gist options
  • Save chsh/6419676 to your computer and use it in GitHub Desktop.
Save chsh/6419676 to your computer and use it in GitHub Desktop.
Index to references can be specified on definition time.
class CreateBags < ActiveRecord::Migration
def change
create_table :bags do |t|
t.references :user, index: true
t.timestamps
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment