添加多态引用的向下迁移是什么 [英] What is the down migration for adding a polymorphic reference
本文介绍了添加多态引用的向下迁移是什么的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在进行以下迁移,但不知道在down
方法中使用什么
I have the folowing migration but don't know what to use in the down
method
change_table :addresses do |t|
t.references :addressable, :polymorphic => true
end
推荐答案
出了什么问题?
def self.down
remove_column :addresses, :addressable_type
remove_column :addresses, :addressable_id
end
这篇关于添加多态引用的向下迁移是什么的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文