【发布时间】:2012-04-16 01:17:21
【问题描述】:
我的用户模型如下所示:
class CreateUsers < ActiveRecord::Migration
def self.up
create_table :users do |t|
t.string :name
t.string :email
t.timestamps
end
end
def self.down
drop_table :users
end
end
如果我想再添加一个 :attribute,最好创建另一个迁移文件来添加新列 (see another Stackoverflow thread) 还是我可以手动添加 t.string :name_of_new_attribute 然后 rake db:migrate?
谢谢!
【问题讨论】:
标签: ruby-on-rails