function shoutbox_schema in Shoutbox 7.2
Same name and namespace in other branches
- 6.2 shoutbox.install \shoutbox_schema()
- 6 shoutbox.install \shoutbox_schema()
- 7 shoutbox.install \shoutbox_schema()
Define the 'shoutbox' schema.
Return value
The schema which contains the structure for the shoutbox module's tables.
File
- ./
shoutbox.install, line 14 - Install, update and uninstall functions for the Shoutbox module.
Code
function shoutbox_schema() {
$schema['shoutbox'] = array(
'description' => 'A table containing the shoutbox posts.',
'fields' => array(
'shout_id' => array(
'type' => 'serial',
'unsigned' => TRUE,
'not null' => TRUE,
'description' => 'The primary identifier for the shout post.',
),
'uid' => array(
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0,
'description' => 'The primary identifier for the shout post author.',
),
'nick' => array(
'type' => 'varchar',
'length' => 60,
'not null' => TRUE,
'description' => 'The author\'s nickname.',
),
'shout' => array(
'type' => 'text',
'size' => 'big',
'not null' => TRUE,
'description' => 'The shout post.',
),
'module' => array(
'type' => 'varchar',
'length' => 64,
'not null' => TRUE,
'description' => 'The module that this shout belongs to.',
),
'moderate' => array(
'type' => 'int',
'not null' => TRUE,
'default' => 0,
'description' => 'The moderation id.',
),
'created' => array(
'type' => 'int',
'not null' => TRUE,
'default' => 0,
'description' => 'Creation date.',
),
'changed' => array(
'type' => 'int',
'not null' => TRUE,
'default' => 0,
'description' => 'Last updated date.',
),
'hostname' => array(
'type' => 'varchar',
'length' => 255,
'default' => 'localhost',
'not null' => TRUE,
'description' => 'The hostname where the post originated.',
),
'sid' => array(
'type' => 'varchar',
'length' => 64,
'not null' => TRUE,
'default' => '',
'description' => 'Session id of the current session.',
),
),
'primary key' => array(
'shout_id',
),
);
return $schema;
}