You are here

webform_anonymous.install in Webform Anonymous 6

Same filename and directory in other branches
  1. 7 webform_anonymous.install

Webform Anonymous module install/schema hooks.

@author Daniel Imhoff

File

webform_anonymous.install
View source
<?php

/**
 * @file
 * Webform Anonymous module install/schema hooks.
 *
 * @author Daniel Imhoff
 */

/**
 * Implements hook_install().
 */
function webform_anonymous_install() {
  drupal_install_schema('webform_anonymous');
}

/**
 * Implements hook_uninstall().
 */
function webform_anonymous_uninstall() {
  drupal_uninstall_schema('webform_anonymous');
}

/**
 * Implements hook_schema().
 */
function webform_anonymous_schema() {
  $schema = array();
  $schema['webform_anonymous'] = array(
    'description' => 'Table for storing the anonymous status for webform nodes.',
    'fields' => array(
      'nid' => array(
        'description' => 'The node identifier of a webform.',
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ),
      'anonymous' => array(
        'description' => 'The anonymous status.',
        'type' => 'int',
        'size' => 'tiny',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
      'locked' => array(
        'description' => 'Whether the anonymity of the results of this webform can or cannot be altered.',
        'type' => 'int',
        'size' => 'tiny',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
      'locked_uid' => array(
        'description' => 'The user ID of the user that locked the results of this webform in an anonymous state.',
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
    ),
    'primary key' => array(
      'nid',
    ),
  );
  return $schema;
}