如何为model1s_model2s has_and_belongs_to_many表创建迁移?

时间:2011-03-06 20:27:36

标签: ruby-on-rails

我有一个has_and_belongs_to_many关系,如何创建迁移以创建连接表?

1 个答案:

答案 0 :(得分:2)

create_table :articles_tags, :id => false do |t|
  t.references :article, :tag
end

取自回答: Do I need to manually create a migration for a HABTM join table?