You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
educoder/db/migrate/20181115071148_create_relat...

14 lines
377 B

6 years ago
class CreateRelationships < ActiveRecord::Migration[5.2]
def change
create_table :relationships do |t|
t.integer :follower_id
t.integer :followed_id
t.timestamps
end
add_index :relationships, :followed_id
add_index :relationships, :follower_id
add_index :relationships, [:follower_id, :followed_id], unique: true
end
end