You are here

w3c_validator.install in W3C Validator 6

Same filename and directory in other branches
  1. 8 w3c_validator.install
  2. 7 w3c_validator.install

File

w3c_validator.install
View source
<?php

/**
 * Implementation of hook_install().
 */
function w3c_validator_install() {
  drupal_install_schema('w3c_validator');
}

/**
 * Implementation of hook_uninstall().
 */
function w3c_validator_uninstall() {
  drupal_uninstall_schema('w3c_validator');
}

/**
 * Implementation of hook_schema().
 */
function w3c_validator_schema() {
  $schema = array();
  $schema['validator_access_tokens'] = array(
    'fields' => array(
      'id' => array(
        'type' => 'serial',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'disp-width' => '11',
      ),
      'token' => array(
        'type' => 'varchar',
        'length' => '32',
        'not null' => FALSE,
      ),
      'timestamp' => array(
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => FALSE,
        'disp-width' => '11',
      ),
      'rand' => array(
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => FALSE,
        'disp-width' => '11',
      ),
      'uid' => array(
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => FALSE,
        'disp-width' => '11',
      ),
    ),
    'primary key' => array(
      'id',
    ),
  );
  return $schema;
}
function w3c_validator_update_6100() {
  $ret = array();
  $table = drupal_get_schema('validator_access_tokens');
  db_create_table($ret, 'validator_access_tokens', $table);
  return $ret;
}

Functions