0
我想将参考键从类更改为Klass。不知道如何做到这一点。我假设它是一个快速列重命名,但我从来没有碰到改变外键。我确定它很简单,但不想搞砸任何东西。更改外键的名称
class Schedule < ActiveRecord::Migration[5.1]
def change
create_table :schedules, id: false do |t|
t.references :class, index: true, foreign_key: true
t.references :student, index: true, foreign_key: true
t.timestamps
end
end
end