learnosity-1.0.x-dev/learnosity.install
learnosity.install
<?php
/**
* @file
* Install, update and uninstall functions for the learnosity module.
*/
/**
* Implements hook_schema().
*/
function learnosity_schema() {
$schema['learnosity_sessions'] = [
'description' => 'Stores the users learnosity session data.',
'fields' => [
'sid' => [
'description' => "Session ID of the user.",
'type' => 'varchar',
'length' => 64,
'not null' => TRUE,
'default' => '',
],
'uid' => [
'description' => "User's {users}.uid.",
'type' => 'int',
'not null' => TRUE,
'default' => 0,
],
'activity_id' => [
'description' => 'The activity_id.',
'type' => 'varchar',
'length' => 128,
'not null' => TRUE,
],
'timestamp' => [
'description' => 'A Unix timestamp indicating when the session was started.',
'type' => 'int',
'not null' => TRUE,
'default' => 0,
],
'status' => [
'description' => 'Status of the Learnosity session (complete, incomplete, ...)',
'type' => 'int',
'not null' => TRUE,
'default' => 0,
],
],
'primary key' => ['sid'],
'indexes' => [
'sid_activity' => ['sid', 'activity_id'],
],
];
return $schema;
}
