You are here

function uuid_table_schema in Universally Unique IDentifier 6

Same name and namespace in other branches
  1. 5 uuid.install \uuid_table_schema()

Return schema for a uuid table.

Parameters

$key: Name of key field, e.g. nid for nodes.

Return value

Array with table structure definition (schema).

3 calls to uuid_table_schema()
uuid_schema in ./uuid.install
Implementation of hook_schema().
uuid_update_6001 in ./uuid.install
Create uuid_vocabulary and uuid_term_data tables.
uuid_update_6003 in ./uuid.install
Create uuid_comment table.

File

./uuid.install, line 60
Install, update and uninstall functions for the uuid module.

Code

function uuid_table_schema($table, $key = 'key') {
  return array(
    'fields' => array(
      $key => array(
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
        'description' => 'The primary key of the record which this UUID was generated for.',
      ),
      'uuid' => array(
        'type' => 'char',
        'length' => 36,
        'not null' => TRUE,
        'default' => '',
        'description' => 'The Universally Unique Identifier.',
      ),
    ),
    'primary key' => array(
      $key,
    ),
    'unique keys' => array(
      'uuid_' . $table . '_uuid_key' => array(
        'uuid',
      ),
    ),
  );
}