【发布时间】:2014-03-03 17:46:11
【问题描述】:
当我为我的 Rails 模型创建附件列时,我使用了:
def self.up
change_table :updates do |t|
t.attachment :image
end
end
def self.down
drop_attached_file :updates, :image
end
我试图以这种方式删除该列,但它说该关系不存在:
remove_column :updates, :image
我怎样才能正确地从更新表中删除此列???
更新 与:图像相关的列
t.string "image_file_name"
t.string "image_content_type"
t.integer "image_file_size"
t.datetime "image_updated_at"
【问题讨论】:
-
没有名为
image的列,是吗?查看您实际拥有的列,例如发布您的db/schema.rb的相关部分。 -
不,不仅仅是相关的列。
标签: ruby-on-rails database postgresql ruby-on-rails-4