Skip to content

Instantly share code, notes, and snippets.

@User195
Created December 11, 2013 23:23
Show Gist options
  • Save User195/7920388 to your computer and use it in GitHub Desktop.
Save User195/7920388 to your computer and use it in GitHub Desktop.
class CreateRelationships < ActiveRecord::Migration
def change
create_table :relationships do |t|
t.integer :follower_id
t.integer :followed_id
t.timestamps
end
add_index :relationships, :follower_id
add_index :relationships, :followed_id
add_index :relationships, [:follower_id, :followed_id], unique: true
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment