page_tester-1.0.x-dev/page_tester.install
page_tester.install
<?php
/**
* Implements hook_schema().
*/
function page_tester_schema() {
$schema['page_tester'] = [
'description' => 'Table that contains logs of all Page Tests.',
'fields' => [
'ptid' => [
'type' => 'serial',
'not null' => TRUE,
'size' => 'big',
'description' => 'Primary Key: Unique Page Tester event ID.',
],
'uid' => [
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0,
'description' => 'The {users}.uid of the user who triggered the event.',
],
'test_id' => [
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0,
'description' => 'The test id.',
],
'test_number' => [
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0,
'description' => 'The test number.',
],
'message' => [
'type' => 'text',
'not null' => TRUE,
'size' => 'big',
'description' => 'Text of log message to be passed into the t() function.',
],
'timestamp' => [
'type' => 'int',
'not null' => TRUE,
'default' => 0,
'description' => 'Unix timestamp of when event occurred.',
'size' => 'big',
],
],
'primary key' => ['ptid'],
];
return $schema;
}
/**
* Implements hook_install().
*/
/* function page_tester_install() {
\Drupal::database()->insert('page_tester_data')->fields(['data', 'comment'])->values(['data' => 'Initial Value', 'comment' => 'This is the initial data'])->execute();
} */
/**
* Implements hook_uninstall().
*/
function page_tester_uninstall() {
\Drupal::database()->delete('page_tester')->execute();
}
