mediamosa_server_schema()Implements hook_schema().
sites/all/modules/mediamosa/core/server/mediamosa_server.install.inc, line 174
<?php
function mediamosa_server_schema() {
$a_types = array(
mediamosa_server_db::SERVER_TYPE_DOWNLOAD,
mediamosa_server_db::SERVER_TYPE_STILL,
mediamosa_server_db::SERVER_TYPE_STREAMING,
mediamosa_server_db::SERVER_TYPE_JOB_PROCESSOR,
mediamosa_server_db::SERVER_TYPE_UPLOAD,
);
$a_status = array(
mediamosa_server_db::SERVER_STATUS_OFF,
mediamosa_server_db::SERVER_STATUS_ON,
mediamosa_server_db::SERVER_STATUS_CLOSE,
);
$a_schema[mediamosa_server_db::TABLE_NAME] = array(
'description' => t('The download server table contains settings for the download servers.'),
'fields' => array(
mediamosa_server_db::NID => array(
'description' => t('The Drupal node id.'),
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
),
mediamosa_server_db::VID => array(
'description' => t('The Drupal node revision id.'),
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
),
mediamosa_server_db::VERSION => array(
'description' => t('The version number.'),
'type' => 'int',
'unsigned' => TRUE,
'not null' => FALSE,
),
mediamosa_server_db::SERVER_STATUS => array(
'description' => t('The server status.'),
'type' => "enum('" . implode("','", $a_status) . "')",
'mysql_type' => "enum('" . implode("','", $a_status) . "')",
'not null' => TRUE,
),
mediamosa_server_db::SERVER_TYPE => array(
'description' => t('The server type.'),
'type' => "enum('" . implode("','", $a_types) . "')",
'mysql_type' => "enum('" . implode("','", $a_types) . "')",
'not null' => TRUE,
),
mediamosa_server_db::URI => array(
'description' => t('The optional URI of the server.'),
'type' => 'varchar',
'length' => mediamosa_server_db::URI_LENGTH,
'not null' => FALSE,
),
mediamosa_server_db::DESCRIPTION => array(
'description' => t('The description of the server.'),
'type' => 'varchar',
'length' => mediamosa_server_db::DESCRIPTION_LENGTH,
'not null' => FALSE,
'default' => '',
),
mediamosa_server_db::CONTAINERS => array(
'description' => t('The optional container names this server can serve.'),
'type' => 'text',
'not null' => FALSE,
),
mediamosa_server_db::OBJECT_CODE => array(
'description' => t('The optional container names the server can serve.'),
'type' => 'text',
'not null' => FALSE,
),
mediamosa_server_db::SERVER_NAME => array(
'description' => t('The optional name of the server.'),
'type' => 'varchar',
'length' => mediamosa_server_db::SERVER_NAME_LENGTH,
'not null' => FALSE,
),
mediamosa_server_db::SLOTS => array(
'description' => t('The maximum number of concurrent transcodes.'),
'type' => 'int',
'not null' => FALSE,
),
mediamosa_server_db::TOOLS => array(
'description' => t('The optional tools this server serves.'),
'type' => 'text',
'not null' => FALSE,
),
mediamosa_server_db::URI_UPLOAD_PROGRESS => array(
'description' => t('The optional uri of the upload progress.'),
'type' => 'varchar',
'length' => mediamosa_server_db::URI_UPLOAD_PROGRESS_LENGTH,
'not null' => FALSE,
),
),
'primary key' => array(mediamosa_server_db::NID),
'indexes' => array(
'idx_nid_vid' => array(mediamosa_server_db::NID, mediamosa_server_db::VID),
'idx_servertype_serverstatus' => array(mediamosa_server_db::NID, mediamosa_server_db::SERVER_TYPE, mediamosa_server_db::SERVER_STATUS),
)
);
return $a_schema;
}
?>