Created
April 27, 2019 02:47
-
-
Save rodloboz/38f4c07cc0e5e727d838a1c77a6110f9 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class CreateFollows < ActiveRecord::Migration[6.0] | |
def change | |
create_table 'follows' do |t| | |
t.integer 'following_id', null: false | |
t.integer 'follower_id', null: false | |
t.timestamps null: false | |
end | |
add_index :follows, :following_id | |
add_index :follows, :follower_id | |
add_index :follows, [:following_id, :follower_id], unique: true | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment