You are here

function edit_limit_schema in Edit Limit 7

Same name and namespace in other branches
  1. 6 edit_limit.install \edit_limit_schema()

Implements hook_schema().

File

./edit_limit.install, line 10
Set up the database tables for Edit Limit.

Code

function edit_limit_schema() {
  $schema['edit_limit_node_count'] = array(
    'fields' => array(
      'nid' => array(
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
        'description' => 'node id for the rating',
      ),
      'count' => array(
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
        'description' => 'number of times this node has been edited',
      ),
    ),
    'primary key' => array(
      'nid',
    ),
  );
  $schema['edit_limit_comment_count'] = array(
    'fields' => array(
      'cid' => array(
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
        'description' => 'comment id for the rating',
      ),
      'count' => array(
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
        'description' => 'number of times this comment has been edited',
      ),
    ),
    'primary key' => array(
      'cid',
    ),
  );
  $schema['edit_limit_node_time'] = array(
    'fields' => array(
      'nid' => array(
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
        'description' => 'node id to be edit-limited',
      ),
      'time' => array(
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
        'description' => 'number of seconds since initial publication this node can be edited',
      ),
      'published' => array(
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
        'description' => 'time of initial publication of this node',
      ),
    ),
    'primary key' => array(
      'nid',
    ),
  );
  $schema['edit_limit_comment_time'] = array(
    'fields' => array(
      'cid' => array(
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
        'description' => 'comment id to be edit-limited',
      ),
      'time' => array(
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
        'description' => 'number of seconds since initial publication this node can be edited',
      ),
      'published' => array(
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
        'description' => 'time of initial publication of this node',
      ),
    ),
    'primary key' => array(
      'cid',
    ),
  );
  return $schema;
}