You are here

services_token_access.install in Services Token Access 7

Install file for the services_token_access module.

File

services_token_access.install
View source
<?php

/**
 * @file
 * Install file for the services_token_access module.
 */

/**
 * Implements hook_schema().
 */
function services_token_access_schema() {
  $schema = array();

  // Create the DB table for the users access tokens.
  $schema['services_token_access_tokens'] = array(
    'description' => 'Stores services token data for users.',
    'fields' => array(
      'uid' => array(
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'description' => 'Primary Key: Unique user ID.',
        'default' => 0,
      ),
      'token' => array(
        'type' => 'varchar',
        'length' => 40,
        'not null' => FALSE,
        'default' => '',
        'description' => "User's access token.",
      ),
      'updated' => array(
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
        'description' => 'Timestamp for when token was generated.',
      ),
    ),
    'unique keys' => array(
      'token' => array(
        'token',
      ),
    ),
    'primary key' => array(
      'uid',
    ),
  );
  return $schema;
}

Functions

Namesort descending Description
services_token_access_schema Implements hook_schema().