You are here

function contact_save_schema in Contact Save 7

Implements hook_schema().

File

./contact_save.install, line 10
Install, update, and uninstall functions for the contact_save module.

Code

function contact_save_schema() {
  $schema['contact_save'] = array(
    'fields' => array(
      'id' => array(
        'type' => 'serial',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ),
      'cid' => array(
        'type' => 'int',
        'not null' => TRUE,
        'default' => 1,
      ),
      'uid' => array(
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
      ),
      'name' => array(
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
      ),
      'mail' => array(
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
      ),
      'subject' => array(
        'type' => 'text',
        'size' => 'big',
        'not null' => TRUE,
      ),
      'message' => array(
        'type' => 'text',
        'size' => 'big',
        'not null' => TRUE,
      ),
      'created' => array(
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
      ),
      'read' => array(
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
      ),
    ),
    'foreign keys' => array(
      'category' => array(
        'table' => 'contact',
        'columns' => array(
          'cid' => 'cid',
        ),
      ),
      'mail_author' => array(
        'table' => 'users',
        'columns' => array(
          'uid' => 'uid',
        ),
      ),
    ),
    'primary key' => array(
      'id',
    ),
  );
  return $schema;
}