You are here

function webprofiler_schema in Devel 8

Same name and namespace in other branches
  1. 8.3 webprofiler/webprofiler.install \webprofiler_schema()
  2. 8.2 webprofiler/webprofiler.install \webprofiler_schema()
  3. 4.x webprofiler/webprofiler.install \webprofiler_schema()

Implements hook_schema().

File

webprofiler/webprofiler.install, line 13
Install, update and uninstall functions for the webprofiler module.

Code

function webprofiler_schema() {
  $schema['webprofiler'] = [
    'description' => 'Webprofiler profiles storage.',
    'fields' => [
      'token' => [
        'description' => 'Profile token.',
        'type' => 'varchar',
        'length' => 6,
        'not null' => TRUE,
      ],
      'data' => [
        'description' => 'Profile data.',
        'type' => 'text',
        'size' => 'big',
        'not null' => TRUE,
      ],
      'ip' => [
        'description' => 'Request IP.',
        'type' => 'varchar',
        'length' => 64,
        'not null' => TRUE,
      ],
      'method' => [
        'description' => 'Request method.',
        'type' => 'varchar',
        'length' => 6,
        'not null' => TRUE,
      ],
      'url' => [
        'description' => 'Requested URL.',
        'type' => 'varchar',
        'length' => 2048,
        'not null' => TRUE,
      ],
      'time' => [
        'description' => 'Request time.',
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ],
      'parent' => [
        'description' => 'Profile parent.',
        'type' => 'varchar',
        'length' => 6,
        'not null' => FALSE,
      ],
      'created_at' => [
        'description' => 'Profile created time.',
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ],
      'status_code' => [
        'description' => 'Profile status code.',
        'type' => 'int',
        'size' => 'small',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ],
    ],
    'indexes' => [
      'created_at' => [
        'created_at',
      ],
      'ip' => [
        'ip',
      ],
      'method' => [
        'method',
      ],
      'parent' => [
        'parent',
      ],
    ],
    'primary key' => [
      'token',
    ],
  ];
  return $schema;
}