【发布时间】:2013-11-17 00:19:45
【问题描述】:
我有一个带有列(名称、路径)的数据库。现在我有一个迁移文件,将列更改为(名称、pathorig、pathjson、scramble)。
执行rake db:reset 和rake db:migrate 不会更新表格。为什么会发生这种情况?
我的迁移文件:
class CreateUploads < ActiveRecord::Migration
def change
create_table :uploads do |t|
t.string :name
t.string :pathorig
t.string :pathjson
t.string :scramble
t.timestamps
end
end
end
schema.rb 文件:
ActiveRecord::Schema.define(version: 20131029072745) do
create_table "uploads", force: true do |t|
t.string "name"
t.string "path"
t.datetime "created_at"
t.datetime "updated_at"
end
end
【问题讨论】:
标签: ruby-on-rails ruby rake dbmigrate