You are here

function apachesolr_attachments_schema in Apache Solr Attachments 6

Same name and namespace in other branches
  1. 6.3 apachesolr_attachments.install \apachesolr_attachments_schema()
  2. 6.2 apachesolr_attachments.install \apachesolr_attachments_schema()
  3. 7 apachesolr_attachments.install \apachesolr_attachments_schema()

Implementation of hook_schema().

File

./apachesolr_attachments.install, line 61

Code

function apachesolr_attachments_schema() {
  $schema['apachesolr_attachments_files'] = array(
    'description' => 'Stores information for uploaded files.',
    'fields' => array(
      'fid' => array(
        'description' => 'Primary Key: Unique files ID.',
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ),
      'nid' => array(
        'description' => 'The {node}.nid where the file is attached.',
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
      'removed' => array(
        'description' => 'file is no longer attached.',
        'type' => 'int',
        'unsigned' => TRUE,
        'default' => 0,
      ),
      'sha1' => array(
        'description' => 'file sha1 to check for changes.',
        'type' => 'varchar',
        'length' => 40,
        'not null' => TRUE,
        'default' => '',
      ),
      'body' => array(
        'description' => 'The cached body (extracted text) of the file (except for text files).',
        'type' => 'text',
        'not null' => FALSE,
        'size' => 'big',
      ),
    ),
    'indexes' => array(
      'nid' => array(
        'nid',
      ),
      'removed' => array(
        'removed',
      ),
    ),
    'primary key' => array(
      'fid',
    ),
  );
  return $schema;
}