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 has been archived by the owner on Apr 17, 2018. It is now read-only.
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.
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 hasAUTOINCREMENT
, MySQL hasAUTO_INCREMENT
, Mongo hasObjectID
s, 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
Original Lighthouse ticket: http://datamapper.lighthouseapp.com/projects/20609/tickets/1483
The text was updated successfully, but these errors were encountered: