You are here

function w3c_validator_schema in W3C Validator 8

Same name and namespace in other branches
  1. 6 w3c_validator.install \w3c_validator_schema()
  2. 7 w3c_validator.install \w3c_validator_schema()

Implements hook_schema().

File

./w3c_validator.install, line 14
Install, update and uninstall functions for the w3c_validator module.

Code

function w3c_validator_schema() {
  $schema['w3c_validator'] = [
    'description' => 'Store already validated URI',
    'fields' => [
      'wid' => [
        'type' => 'serial',
        'not null' => TRUE,
        'description' => 'Primary Key: Unique link ID.',
      ],
      'uri' => [
        'type' => 'text',
        'not null' => TRUE,
        'description' => 'The full qualified link.',
      ],
      'error_count' => [
        'description' => 'Number of errors found during validation.',
        'type' => 'int',
        'unsigned' => TRUE,
        'size' => 'small',
        'not null' => TRUE,
        'default' => 0,
        'disp-width' => '5',
      ],
      'errors' => [
        'description' => 'Detailled information about validation errors.',
        'type' => 'text',
        'size' => 'big',
      ],
      'warning_count' => [
        'description' => 'Number of warnings found during validation.',
        'type' => 'int',
        'unsigned' => TRUE,
        'size' => 'small',
        'not null' => TRUE,
        'default' => 0,
        'disp-width' => '5',
      ],
      'warnings' => [
        'description' => 'Detailled information about warning errors.',
        'type' => 'text',
        'size' => 'big',
      ],
      'info_count' => [
        'description' => 'Number of infos found during validation.',
        'type' => 'int',
        'unsigned' => TRUE,
        'size' => 'small',
        'not null' => TRUE,
        'default' => 0,
        'disp-width' => '5',
      ],
      'infos' => [
        'description' => 'Detailled information about infos.',
        'type' => 'text',
        'size' => 'big',
      ],
      'validity' => [
        'description' => 'A flag : TRUE if the validation is valid.',
        'type' => 'int',
        'default' => 0,
        'not null' => TRUE,
      ],
      'need_validation' => [
        'description' => 'A flag : TRUE is re-validation is needed.',
        'type' => 'int',
        'default' => 1,
        'not null' => TRUE,
      ],
      'doctype' => [
        'description' => 'Doctype of this page.',
        'type' => 'varchar',
        'length' => '255',
        'not null' => TRUE,
        'default' => 'unknown',
      ],
      'charset' => [
        'description' => 'Charset of this page.',
        'type' => 'varchar',
        'length' => '255',
        'not null' => TRUE,
        'default' => 'unknown',
      ],
    ],
    'primary key' => [
      'wid',
    ],
  ];
  $schema['w3c_access_token'] = [
    'fields' => [
      'id' => [
        'type' => 'serial',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ],
      'token' => [
        'type' => 'varchar',
        'length' => '32',
        'not null' => FALSE,
      ],
      'expiration' => [
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => FALSE,
      ],
      'rand' => [
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => FALSE,
      ],
      'uid' => [
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => FALSE,
      ],
    ],
    'primary key' => [
      'id',
    ],
  ];
  return $schema;
}