You are here

function feedback_schema in Feedback 7.2

Same name and namespace in other branches
  1. 6.2 feedback.install \feedback_schema()

Implements hook_schema().

File

./feedback.install, line 11
Installation functions for Feedback module.

Code

function feedback_schema() {
  $schema['feedback'] = array(
    'description' => 'Stores all feedback messages.',
    'fields' => array(
      'fid' => array(
        'description' => 'Feedback message ID.',
        'type' => 'serial',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ),
      'uid' => array(
        'description' => 'User ID of the feedback message author.',
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
      'status' => array(
        'description' => 'Feedback status (0 = new, 1 = processed).',
        'type' => 'int',
        'size' => 'tiny',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
      'message' => array(
        'description' => 'The feedback message.',
        'type' => 'text',
        'size' => 'big',
        'not null' => TRUE,
      ),
      'location' => array(
        'description' => 'System path of the originating page.',
        'type' => 'text',
        'not null' => TRUE,
      ),
      'location_masked' => array(
        'description' => 'Untranslated system path of the originating page.',
        'type' => 'text',
        'not null' => TRUE,
      ),
      'url' => array(
        'description' => 'Absolute URL of the originating page.',
        'type' => 'text',
        'not null' => TRUE,
      ),
      'useragent' => array(
        'description' => 'User agent of the feedback message author.',
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
      ),
      // @todo Rename to created. Also add 'changed'.
      'timestamp' => array(
        'description' => 'UNIX timestamp of the feedback message creation date.',
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
      ),
    ),
    'primary key' => array(
      'fid',
    ),
    'indexes' => array(
      'location' => array(
        array(
          'location',
          32,
        ),
      ),
      'location_masked' => array(
        array(
          'location_masked',
          32,
        ),
      ),
    ),
  );
  return $schema;
}