You are here

function shoutbox_schema in Shoutbox 6.2

Same name and namespace in other branches
  1. 6 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' => '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;
}