You are here

function activity_schema in Activity 8

Same name and namespace in other branches
  1. 6.2 activity.install \activity_schema()
  2. 6 activity.install \activity_schema()
  3. 7 activity.install \activity_schema()

Implements hook_schema().

File

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

Code

function activity_schema() {
  $schema['activity_events'] = [
    'description' => 'Maps events to hook and operation assignments from activity module.',
    'fields' => [
      'event_id' => [
        'type' => 'serial',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'description' => 'The Unique id of the message',
      ],
      'hook' => [
        'type' => 'varchar',
        'length' => 128,
        'not null' => TRUE,
        'default' => '',
        'description' => 'The name of hook, e.g. Save content.',
      ],
      'label' => [
        'type' => 'varchar',
        'length' => 128,
        'not null' => TRUE,
        'default' => '',
        'description' => "Primary Key: Action's label.",
      ],
      'userId' => [
        'type' => 'int',
        'unsigned' => TRUE,
        'disp-width' => '10',
        'not null' => TRUE,
        'description' => "The user id.",
      ],
      'created' => [
        'type' => 'int',
        'unsigned' => TRUE,
        'disp-width' => '11',
        'not null' => TRUE,
        'description' => "The time when the action is created.",
      ],
      'message' => [
        'descripiton' => 'The full plaintext message.',
        'type' => 'text',
        'size' => 'big',
        'not null' => FALSE,
      ],
    ],
    'primary key' => [
      'event_id',
    ],
  ];
  $schema['activity'] = [
    'fields' => [
      'action_id' => [
        'type' => 'serial',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'description' => 'The Unique id of the message',
      ],
      'event_id' => [
        'type' => 'varchar',
        'length' => 128,
        'not null' => TRUE,
        'default' => '',
        'description' => 'The event id related to activity_events table.',
      ],
      'entity_type' => [
        'type' => 'varchar',
        'length' => 128,
        'not null' => TRUE,
        'default' => '',
        'description' => 'The entity type, e.g. node.',
      ],
      'nid' => [
        'type' => 'int',
        'unsigned' => TRUE,
        'disp-width' => '10',
        'not null' => FALSE,
        'description' => "The node id.",
      ],
      'uid' => [
        'type' => 'int',
        'unsigned' => TRUE,
        'disp-width' => '10',
        'not null' => FALSE,
        'description' => "The user id.",
      ],
      'created' => [
        'type' => 'int',
        'unsigned' => TRUE,
        'disp-width' => '11',
        'not null' => TRUE,
        'description' => "The time when the action is created.",
      ],
      'status' => [
        'type' => 'int',
        'unsigned' => TRUE,
        'disp-width' => '10',
        'not null' => TRUE,
        'description' => "The status.",
      ],
      'message' => [
        'descripiton' => 'The full plaintext message',
        'type' => 'text',
        'size' => 'big',
        'not null' => TRUE,
      ],
    ],
    'primary key' => [
      'action_id',
    ],
  ];
  return $schema;
}