IDにbigintを使用する方法
createテーブルのキーワード引数(ID)にbigintを渡す
外部キーにbigintを指定する方法
t.referencesでlimitを指定してあげる
class Users < ActiveRecord::Migration[5.0]
def change
create_table :users, id: :bigint do |t|
t.references :company, foreign_key: true, limit: 8
t.string :name
t.timestamps
end
end
end