Facebook
From Cute Armadillo, 3 Years ago, written in Plain Text.
Embed
Download Paste or View Raw
Hits: 66
  1. /**
  2.  * Implements hook_schema().
  3.  */
  4. function hello_schema() {
  5.   $schema['hello_user_statistics'] = [
  6.     'description' => 'Stores user connection statistics.',
  7.     'fields' => [
  8.       'id' => [
  9.         'type' => 'serial',
  10.         'description' => 'Primary Key: Unique history ID.',
  11.         'unsigned' => TRUE,
  12.         'not null' => TRUE,
  13.       ],
  14.       'time' => [
  15.         'type' => 'int',
  16.         'description' => 'Timestamp of user action.',
  17.         'unsigned' => TRUE,
  18.         'not null' => TRUE,
  19.       ],
  20.       'uid' => [
  21.         'type' => 'int',
  22.         'description' => 'Store user action.',
  23.         'unsigned' => TRUE,
  24.         'not null' => TRUE,
  25.       ],
  26.       'action' => [
  27.         'type' => 'int',
  28.         'size' => 'tiny',
  29.         'description' => 'Action.',
  30.         'not null' => TRUE,
  31.       ],
  32.     ],
  33.     'primary key' => ['id'],
  34.   ];
  35.  
  36.   return $schema;
  37. }