You are here

function search_files_directories_schema in Search Files 7.2

Same name and namespace in other branches
  1. 6.2 search_files_directories.install \search_files_directories_schema()

@file Installation and update procedures for the search directories module.

File

./search_files_directories.install, line 8
Installation and update procedures for the search directories module.

Code

function search_files_directories_schema() {
  $schema['search_files_directories_directories'] = array(
    'description' => 'list of directories that we will index',
    'fields' => array(
      'id' => array(
        'description' => 'unique id of the directory',
        'type' => 'serial',
        'not null' => TRUE,
      ),
      'filepath' => array(
        'description' => 'the system path of the directory',
        'type' => 'varchar',
        'length' => '255',
        'not null' => TRUE,
      ),
      'uripath' => array(
        'description' => 'the web path for the directory',
        'type' => 'varchar',
        'length' => '255',
        'not null' => TRUE,
      ),
    ),
    'primary key' => array(
      'id',
    ),
    'unique keys' => array(
      'filepath' => array(
        'filepath',
      ),
    ),
  );
  $schema['search_files_directories_files'] = array(
    'description' => 'list of files in the directories',
    'fields' => array(
      'id' => array(
        'description' => 'the unique id of the file',
        'type' => 'serial',
        'not null' => TRUE,
      ),
      'path' => array(
        'description' => 'the path of the file in the parent directory',
        'type' => 'varchar',
        'length' => '255',
        'not null' => TRUE,
      ),
      'directory_id' => array(
        'description' => 'the parent directory',
        'type' => 'int',
        'not null' => TRUE,
      ),
      'index_attempts' => array(
        'description' => 'how many times we have attempted to index this file',
        'type' => 'int',
        'size' => 'tiny',
        'not null' => TRUE,
      ),
    ),
    'primary key' => array(
      'id',
    ),
    'unique keys' => array(
      'path' => array(
        'path',
        'directory_id',
      ),
    ),
  );
  return $schema;
}