⧼vector-jumptocontent⧽

Uuid field: Difference between revisions

From EPrints Documentation
mNo edit summary
Added better description. Amended Database section so correct length varchar
Line 3: Line 3:


== Description ==
== Description ==
This field stores a universally unique identifier. This might be a hash (e.g. MD5 or SHA1).
This field type automatically generates a UUID using the <tt>APR::UUID</tt> Perl module, which is part of mod_perl. The UUID is prepended with <tt>urn:uuid:</code> to namespace it to the global system of UUID URIs. (E.g. <tt>urn:uuid:123e4567-e89b-12d3-a456-426614174000</tt>).
 


== Inheritance ==
== Inheritance ==
Line 17: Line 18:
| name || default || description  
| name || default || description  
|-
|-
| '''maxlength''' || 45 || '''Different default.'''
| '''maxlength''' || 45 || '''Different default. Should not be locally modified.'''
|-
|-
| '''text_index''' || 0 || '''Different default.'''
| '''text_index''' || 0 || '''Different default.'''
Line 27: Line 28:
== Database ==
== Database ==
Uuid fields are stored in the database as
Uuid fields are stored in the database as
  fieldname VARCHAR(255)
  fieldname VARCHAR(45)


== API ==
== API ==

Revision as of 08:22, 11 April 2023


Description

This field type automatically generates a UUID using the APR::UUID Perl module, which is part of mod_perl. The UUID is prepended with urn:uuid: to namespace it to the global system of UUID URIs. (E.g. urn:uuid:123e4567-e89b-12d3-a456-426614174000).


Inheritance

Additional Properties

As for Id fields except for

name default description
maxlength 45 Different default. Should not be locally modified.
text_index 0 Different default.

Required Phrases

No additional phrases beyond those required for Id fields.

Database

Uuid fields are stored in the database as

fieldname VARCHAR(45)

API

See API page.

Examples

Most basic example.

{
    name => 'uuid',
    type => 'uuid',
},