创建字符串时,迁移不会侦听

时间:2013-04-27 23:03:14

标签: ruby-on-rails migration

我进行了以下迁移,它仍然以整数形式创建主键:id。这有什么原因会发生吗?

create_table :offers, :id => :false do |t|
  t.string :id, :limit => 36, :primary => true
  t.string :app_id
  t.integer :bid
  t.boolean :active, :default => false
  t.timestamps
end

这是控制台输出

-- create_table(:offers, {:id=>:false})
NOTICE:  CREATE TABLE will create implicit sequence "offers_id_seq" for serial column "offers.id"
NOTICE:  CREATE TABLE / PRIMARY KEY will create implicit index "offers_pkey" for table "offers"
   -> 0.0047s

1 个答案:

答案 0 :(得分:0)

找出答案。应为false而不是:false