feature/share-libs
rb 13 lines 364 Bytes
Raw
1 class CreateRelationships < ActiveRecord::Migration[6.1]
2 def change
3 create_table :relationships do |t|
4 t.integer :follower_id
5 t.integer :followed_id
6
7 t.timestamps
8 end
9 add_index :relationships, :follower_id
10 add_index :relationships, :followed_id
11 add_index :relationships, [:follower_id, :followed_id], unique: true
12 end
13 end