Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想使用 UUID 作为我在带有 postgres db 的 ruby on rails 中的默认密钥,我希望 Postgres 生成密钥。这样做的 RoR 方式是什么?
这似乎可以解决问题:
create_table(:deals, :id => false) do |t| t.uuid :uuid, :null => false t.integer :quantity t.timestamps end add_index(:deals, :uuid, :unique => true, :name => 'deals_pkey')