You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 17, 2018. It is now read-only.
Repository navigation
This repository was archived by the owner on Apr 17, 2018. It is now read-only.
Ability to have non-primary key Serial properties #48
One should be able to create a field whose value defaults to being a guaranteed unique value.
Most databases have methods for creating guaranteed-unique default values that are not primary keys. For example, Postgres has SERIAL, SQLite has AUTOINCREMENT, MySQL has AUTO_INCREMENT, Mongo has ObjectIDs, etc. It would be useful to be able to set a property's default value to be unique without making it a primary key or imposing a uniqueness constraint on the field.
Currently, specifying property :id, Serial, :key => false, :unique => false will still generate a primary key and a uniqueness constraint on the field. It would be very useful if this would work as expected.
Created by Joshua Griffith - 2011-02-08 02:48:56 UTC
There’s an idea of a unique object identifier which will probably replace Serial at some point. If you need a unique property which is not an identifier you can use UUID from dm-types.
Activity
solnic commentedon May 17, 2011
There’s an idea of a unique object identifier which will probably replace Serial at some point. If you need a unique property which is not an identifier you can use UUID from dm-types.
by Piotr Solnica (solnic)