You are here

function tacjs_log_schema in TacJS 8.6

Creates the tables using the schema API.

File

tacjs_log/tacjs_log.install, line 6

Code

function tacjs_log_schema() {
  $schema['tacjslog'] = array(
    'description' => 'The proof of consent.',
    'fields' => [
      'uid' => [
        'description' => 'Primary Key: unique ID.',
        'type' => 'serial',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ],
      'timestamp' => [
        'description' => 'The Timestamp.',
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
      ],
      'ip_address' => [
        'description' => 'The IP address.',
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
      ],
      'services_allowed' => [
        'description' => 'The service.',
        'type' => 'text',
        'not null' => TRUE,
      ],
    ],
    'primary key' => [
      'uid',
    ],
    'indexes' => [
      'uid' => [
        'uid',
      ],
    ],
  );
  return $schema;
}