mediamosa_aut_name_schema()Implements hook_schema().
sites/all/modules/mediamosa/core/aut/name/mediamosa_aut_name.install.inc, line 52
<?php
function mediamosa_aut_name_schema() {
$a_schema[mediamosa_aut_name_db::TABLE_NAME] = array(
'description' => t('This table stores named entities on which autorization can be linked.'),
'fields' => array(
mediamosa_aut_name_db::ID => array(
'type' => 'serial',
'unsigned' => TRUE,
'not null' => TRUE,
'description' => t('Primary Key: Unique ID.'),
),
mediamosa_aut_name_db::APP_ID => array(
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'description' => t('The application ID.'),
),
mediamosa_aut_name_db::AUT_GROUP_ID => array(
'type' => 'int',
'unsigned' => TRUE,
'not null' => FALSE,
'description' => t('The optional group ID if name is part of group.'),
),
mediamosa_aut_name_db::AUT_NAME => array(
'type' => 'varchar',
'length' => mediamosa_aut_name_db::AUT_NAME_LENGTH,
'not null' => TRUE,
'default' => '',
'description' => t('The name of the entity.'),
),
mediamosa_aut_name_db::AUT_PREFIX => array(
'type' => 'varchar',
'length' => mediamosa_aut_name_db::AUT_PREFIX_LENGTH,
'not null' => FALSE,
'default' => NULL,
'description' => t('The optional prefix of the entity, only used with REALM type.'),
),
mediamosa_aut_name_db::AUT_TYPE => array(
'type' => "enum('" . implode("','", array(mediamosa_aut_name_db::AUT_TYPE_DOMAIN, mediamosa_aut_name_db::AUT_TYPE_REALM, mediamosa_aut_name_db::AUT_TYPE_USER, mediamosa_aut_name_db::AUT_TYPE_USER_GROUP)) . "')",
'not null' => TRUE,
'mysql_type' => "enum('" . implode("','", array(mediamosa_aut_name_db::AUT_TYPE_DOMAIN, mediamosa_aut_name_db::AUT_TYPE_REALM, mediamosa_aut_name_db::AUT_TYPE_USER, mediamosa_aut_name_db::AUT_TYPE_USER_GROUP)) . "')",
'default' => mediamosa_aut_name_db::AUT_TYPE_DOMAIN,
'description' => t('The type of name entity.'),
),
),
'primary key' => array(mediamosa_aut_name_db::ID),
'unique keys' => array(
'uni_app_type_name_prefix' => array(mediamosa_aut_name_db::APP_ID, mediamosa_aut_name_db::AUT_TYPE, mediamosa_aut_name_db::AUT_NAME, mediamosa_aut_name_db::AUT_PREFIX),
),
'indexes' => array(
'idx_groupid' => array(mediamosa_aut_name_db::AUT_GROUP_ID),
'idx_app_type_groupid_name_prefix' => array(mediamosa_aut_name_db::APP_ID, mediamosa_aut_name_db::AUT_TYPE, mediamosa_aut_name_db::AUT_GROUP_ID, mediamosa_aut_name_db::AUT_NAME, mediamosa_aut_name_db::AUT_PREFIX),
),
);
return $a_schema;
}
?>