You are here

function guestbook_schema in Guestbook 6.2

Same name and namespace in other branches
  1. 6 guestbook.install \guestbook_schema()
  2. 7.2 guestbook.install \guestbook_schema()

Implementation of hook_schema().

File

./guestbook.install, line 6

Code

function guestbook_schema() {
  $schema['guestbook'] = array(
    'fields' => array(
      'id' => array(
        'type' => 'serial',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ),
      'recipient' => array(
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
      'author' => array(
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
      'anonname' => array(
        'type' => 'varchar',
        'length' => '128',
        'not null' => FALSE,
        'default' => '',
      ),
      'anonemail' => array(
        'type' => 'varchar',
        'length' => '128',
        'not null' => FALSE,
        'default' => '',
      ),
      'anonwebsite' => array(
        'type' => 'varchar',
        'length' => '128',
        'not null' => FALSE,
        'default' => '',
      ),
      'message' => array(
        'type' => 'text',
        'not null' => TRUE,
      ),
      'commentauthor' => array(
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
      'comment' => array(
        'type' => 'text',
        'not null' => TRUE,
      ),
      'status' => array(
        'type' => 'int',
        'size' => 'tiny',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 1,
      ),
      'created' => array(
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
    ),
    'indexes' => array(
      'recipient' => array(
        'recipient',
      ),
      'commentauthor' => array(
        'commentauthor',
      ),
      'created' => array(
        'created',
      ),
    ),
    'primary key' => array(
      'id',
    ),
  );
  return $schema;
}