0

我进行了以下迁移,它仍在将主键创建: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
4

1 回答 1

0

想出了答案。应该false不是:false

于 2013-04-27T23:37:59.350 回答