【发布时间】:2015-07-08 06:35:09
【问题描述】:
如何运行 Sequel 迁移,使用行中的值更新新添加的列?
Sequel 文档展示了如何使用静态值更新列:
self[:artists].update(:location=>'Sacramento')
我需要做的是用 ID 列的值更新新列:
类似:
self[:artists].each |artist| do
artist.update(:location => artist[:id])
end
但上述方法不起作用,我一直无法弄清楚如何让它去。
谢谢!
【问题讨论】: