You are here

favorites.install in Favorites 8.2

Same filename and directory in other branches
  1. 6 favorites.install
  2. 7.2 favorites.install
  3. 7 favorites.install

Install and uninstall functions for the Myfav module.

File

favorites.install
View source
<?php

/**
* @file
* Install and uninstall functions for the Myfav module.
*/

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

Functions

Namesort descending Description
favorites_schema Implements hook_schema()