You are here

function shoutbox_schema in Shoutbox 6

Same name and namespace in other branches
  1. 6.2 shoutbox.install \shoutbox_schema()
  2. 7.2 shoutbox.install \shoutbox_schema()
  3. 7 shoutbox.install \shoutbox_schema()

Define the 'shoutbox' and 'shoutbox_moderation' table structures.

Return value

The schema which contains the structure for the shoutbox module's tables.

File

./shoutbox.install, line 14
Shoutbox module install file.

Code

function shoutbox_schema() {
  $schema['shoutbox'] = array(
    'description' => t('A table containing the shoutbox posts.'),
    'fields' => array(
      'shout_id' => array(
        'type' => 'serial',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'description' => t('The primary identifier for the shout post.'),
      ),
      'uid' => array(
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
        'description' => t('The primary identifier for the shout post author.'),
      ),
      'nick' => array(
        'type' => 'varchar',
        'length' => 32,
        'not null' => TRUE,
        'description' => t('The author\'s nickname.'),
      ),
      'shout' => array(
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'description' => t('The shout post.'),
      ),
      'url' => array(
        'type' => 'varchar',
        'length' => 100,
        'not null' => TRUE,
        'description' => t('The url of the post.'),
      ),
      'moderate' => array(
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
        'description' => t('The moderation id.'),
      ),
      'created' => array(
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
        'description' => t('Creation date.'),
      ),
      'changed' => array(
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
        'description' => t('Last updated date.'),
      ),
      'hostname' => array(
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'description' => t('The hostname where the post originated.'),
      ),
      'sid' => array(
        'type' => 'varchar',
        'length' => 64,
        'not null' => TRUE,
        'default' => '',
        'description' => t('Session id of the current session.'),
      ),
    ),
    'primary key' => array(
      'shout_id',
    ),
  );
  return $schema;
}