【发布时间】:2018-07-24 12:34:00
【问题描述】:
在我的 schema.rb 中,
create_table "devices", force: :cascade do |t|
t.string "uuid"
t.bigint "device_return_id"
t.index ["device_return_id"], name: "index_devices_on_device_return_id"
end
create_table "device_returns", force: :cascade do |t|
t.string "code"
t.datetime "returned_at"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
end
add_foreign_key "devices", "device_returns", column: "device_return_id"
如何使用 rails g migration 将所有“device_return”更改为“exchange”?
我厌倦了 rename_table 和 rename_index。他们没有改变 t.index["device_return_id']
谢谢
【问题讨论】:
标签: ruby-on-rails database activerecord migration schema