You are here

function favorites_schema in Favorites 7

Same name and namespace in other branches
  1. 8.2 favorites.install \favorites_schema()
  2. 6 favorites.install \favorites_schema()
  3. 7.2 favorites.install \favorites_schema()

Implementats hook_schema().

File

./favorites.install, line 11
Install, update and uninstall functions for the Favorites module.

Code

function favorites_schema() {
  $schema = array();
  $schema['favorites'] = array(
    'description' => "Stores each user's favorite path.",
    'fields' => array(
      'fid' => array(
        'description' => 'The unique ID of the favoite',
        'type' => 'serial',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ),
      'uid' => array(
        'description' => 'The user ID of the user who owns the favorite.',
        'type' => 'int',
        'size' => 'normal',
        'not null' => TRUE,
      ),
      'path' => array(
        'description' => 'The favorited path',
        'type' => 'varchar',
        'length' => 1024,
        'not null' => TRUE,
      ),
      'title' => array(
        'description' => 'The title of the favorite',
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
      ),
      'query' => array(
        'description' => "The query parameters for the saved path.",
        'type' => 'varchar',
        'length' => 1024,
        'not null' => TRUE,
      ),
      'timestamp' => array(
        'description' => "The time the favorite was created",
        'type' => 'int',
        'size' => 'normal',
        'not null' => TRUE,
      ),
    ),
    'primary key' => array(
      'fid',
    ),
    'indexes' => array(
      'uid' => array(
        'uid',
      ),
    ),
  );
  return $schema;
}