class CreateFriendships < ActiveRecord::Migration[6.0] def change create_table :friendships do |t| t.references :user, null: false, foreign_key: { to_table: :users } t.references :friend, null: false, foreign_key: { to_table: :users } t.integer :status, default: 0, limit: 1 t.timestamps end end end